(t *testing.T, msg string, details map[string]any, shell bool)
| 58 | } |
| 59 | |
| 60 | func assertShellRefusal(t *testing.T, msg string, details map[string]any, shell bool) { |
| 61 | t.Helper() |
| 62 | _, has := details["upgrade_url"] |
| 63 | if shell && has { |
| 64 | t.Errorf("shell request: details carry upgrade_url %v, want absent", details["upgrade_url"]) |
| 65 | } |
| 66 | if !shell && !has { |
| 67 | t.Errorf("browser request: details lack upgrade_url, want /settings/billing (details=%v)", details) |
| 68 | } |
| 69 | if details["feature"] == nil || details["limit"] == nil { |
| 70 | t.Errorf("details lost the refusal's facts: %v", details) |
| 71 | } |
| 72 | if shell { |
| 73 | low := strings.ToLower(msg) |
| 74 | for _, w := range upgradeWords { |
| 75 | if strings.Contains(low, w) { |
| 76 | t.Errorf("shell message %q contains %q", msg, w) |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func TestPlanLimit_NativeShell_SingleDoor(t *testing.T) { |
| 83 | t.Parallel() |
no test coverage detected