Skip to content

Commit

Permalink
Fix date related test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Watson committed Jan 9, 2023
1 parent e77ff42 commit 3cc8885
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/kbn-i18n/src/core/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,13 @@ describe('I18n engine', () => {
i18n.translate('a.short', {
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
} as any)
).toBe('Coupon expires at 6:40 PM');
).toBe('Coupon expires at 6:40PM');

expect(
i18n.translate('a.medium', {
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
} as any)
).toBe('Coupon expires at 6:40:30 PM');
).toBe('Coupon expires at 6:40:30PM');
});

test('should format default messages with time formatter', () => {
Expand All @@ -679,14 +679,14 @@ describe('I18n engine', () => {
defaultMessage: 'Coupon expires at {expires, time, short}',
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
})
).toBe('Coupon expires at 6:40 PM');
).toBe('Coupon expires at 6:40PM');

expect(
i18n.translate('foo', {
defaultMessage: 'Coupon expires at {expires, time, medium}',
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
})
).toBe('Coupon expires at 6:40:30 PM');
).toBe('Coupon expires at 6:40:30PM');
});

test('should format message with a custom format', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ describe('CurationsTable', () => {
expect(tableContent).toContain('mountains, valleys');

expect(tableContent).toContain('Last updated');
expect(tableContent).toContain('Jan 1, 1970 12:00 PM');
expect(tableContent).toContain('Jan 2, 1970 12:00 PM');
expect(tableContent).toContain('Jan 1, 1970 12:00PM');
expect(tableContent).toContain('Jan 2, 1970 12:00PM');
});

it('renders queries with curation links and curation suggestion badges', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('api_itom', () => {
let externalService: jest.Mocked<ExternalServiceITOM>;
const eventParamsWithFormattedDate = {
...itomEventParams,
time_of_event: '2021-10-13, 10:51:44',
time_of_event: '10/13/2021, 10:51:44',
};

beforeEach(() => {
Expand Down

0 comments on commit 3cc8885

Please sign in to comment.