Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/commandcenter/executive_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/modules/commandcenter/executive_test.go |
| Original SHA-256 | 19420ad6048ff4a9b435b4eb56924a8fdbd4f2a5a10ad539619d3698165b722b |
| Git blob SHA | e664cc60d1a95452a02f22e6c2adb804e8231706 |
| Reading-copy SHA-256 | 19420ad6048ff4a9b435b4eb56924a8fdbd4f2a5a10ad539619d3698165b722b |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/modules/commandcenter/executive_test.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/executive_test.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
Recovered source transcript
Download complete source text ↓59 lines · 2.1 KB
package commandcenter
import (
"strings"
"testing"
)
func strPtr(s string) *string { return &s }
func TestExecutiveCardsHonestEmptyStates(t *testing.T) {
v := View{Meta: Meta{Empty: true}}
cards := buildExecutiveCards(v, 0, 0)
if len(cards) != 4 {
t.Fatalf("want 4 cards, got %d", len(cards))
}
for _, c := range cards {
if !c.NoData {
t.Fatalf("card %s must report no data on an empty org", c.Key)
}
if c.DataNote == "" || !strings.Contains(c.DataNote, "Feeds from") {
t.Fatalf("card %s must NAME what feeds it, got %q", c.Key, c.DataNote)
}
if c.Value != "" && c.Key != "revenue_at_risk" {
t.Fatalf("card %s must not fake a number, got %q", c.Key, c.Value)
}
}
}
func TestExecutiveCardsRealNumbers(t *testing.T) {
v := View{
MissionReadiness: MissionReadiness{Score: "86.00", Band: "yellow", Status: "Watch"},
Banner: Banner{TotalClearedWorkforce: 40, ProposalReadyCandidates: 12, ActiveRequirements: 9},
StaffingGaps: []Gap{
{Unmet: 5, ValueAtRisk: strPtr("1200000"), PricedOpportunities: 2, UnpricedOpportunities: 1, ValueRepresentative: true},
{Unmet: 3, ValueAtRisk: strPtr("300000"), PricedOpportunities: 1},
},
}
cards := buildExecutiveCards(v, 6, 9)
byKey := map[string]ExecutiveCard{}
for _, c := range cards {
byKey[c.Key] = c
}
if byKey["mission_readiness"].Value != "86.00" || byKey["mission_readiness"].State != "watch" {
t.Fatalf("mission readiness card wrong: %+v", byKey["mission_readiness"])
}
if byKey["revenue_at_risk"].Value != "$1500000" {
t.Fatalf("revenue at risk must sum the gap exposure exactly, got %q", byKey["revenue_at_risk"].Value)
}
if !strings.Contains(byKey["revenue_at_risk"].Detail, "3 priced") || !strings.Contains(byKey["revenue_at_risk"].Detail, "representative") {
t.Fatalf("revenue detail must state the counted basis: %q", byKey["revenue_at_risk"].Detail)
}
if byKey["growth_capacity"].Value != "4" {
t.Fatalf("growth capacity = ready 12 minus unmet 8 = 4, got %q", byKey["growth_capacity"].Value)
}
if byKey["staffing_confidence"].Value != "67%" {
t.Fatalf("staffing confidence = 6 of 9 = 67 percent, got %q", byKey["staffing_confidence"].Value)
}
}