Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lib/formatters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const COUNTRY_NAMES = {
ARE: 'United Arab Emirates',
AUT: 'Austria',
BGR: 'Bulgaria',
BRA: 'Brazil',
Expand All @@ -10,7 +11,7 @@ const COUNTRY_NAMES = {
FRA: 'France',
GBR: 'United Kingdom',
IND: 'India',
IRN: 'Iran',
IRN: 'Middle East',
ITA: 'Italy',
JPN: 'Japan',
LTU: 'Lithuania',
Expand Down
14 changes: 13 additions & 1 deletion src/lib/formatters.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { formatDayMonth, formatShortDate, formatUtcTime } from './formatters';
import {
formatDayMonth,
formatShortDate,
formatUtcTime,
getCountryName,
} from './formatters';

describe('date formatters', () => {
const superblockDate = 'April 20th 2026, 2:15:21 pm';
Expand All @@ -12,3 +17,10 @@ describe('date formatters', () => {
expect(formatUtcTime(superblockDate)).toBe('2:15 PM');
});
});

describe('country formatters', () => {
test('uses a regional Middle East label for IRN', () => {
expect(getCountryName('ARE')).toBe('United Arab Emirates');
expect(getCountryName('IRN')).toBe('Middle East');
});
});
Loading