also looking at this
fix(dashboard): the regions panel says California, not CA
#63
4 files
+145
-9
| @@ -180,10 +180,17 @@ describe('the dashboard panel is off until a site turns it on', () => { | ||
| 180 | 180 | }) |
| 181 | 181 | |
| 182 | 182 | test('inside one country the flag is dropped, since every row would repeat it', () => { |
| 183 | expect(view).toContain('regionCountry ? parts.subdivision : `${flag(parts.country)} ${parts.subdivision}`') | |
| 183 | expect(view).toContain('regionCountry ? named : `${flag(parts.country)} ${named}`') | |
| 184 | 184 | expect(view).toContain('`Regions in ${countryName(regionCountry)}`') |
| 185 | 185 | }) |
| 186 | 186 | |
| 187 | test('a row is labelled by name, falling back to the code', () => { | |
| 188 | // `PH-07` says nothing to a reader and `CA` beside a flag is equally | |
| 189 | // Canada, so the panel prints the subdivision's name. A code the table | |
| 190 | // cannot name keeps showing the code rather than inventing one. | |
| 191 | expect(view).toContain('subdivisionName(r.region) ?? parts.subdivision') | |
| 192 | }) | |
| 193 | ||
| 187 | 194 | test('the toggle is :checked + @change, never x-model', () => { |
| 188 | 195 | // x-model would own the value, and the value is the server's until a request |
| 189 | 196 | // succeeds — an optimistic tick that then failed would leave the box saying |