-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into redesign/44541--new-monitor-list-expanded-row
- Loading branch information
Showing
56 changed files
with
1,070 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
x-pack/legacy/plugins/apm/public/components/shared/TimestampTooltip/__test__/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { shallow } from 'enzyme'; | ||
import React from 'react'; | ||
import moment from 'moment-timezone'; | ||
import { TimestampTooltip } from '../index'; | ||
import { mockNow } from '../../../../utils/testHelpers'; | ||
|
||
describe('TimestampTooltip', () => { | ||
const timestamp = 1570720000123; // Oct 10, 2019, 08:06:40.123 (UTC-7) | ||
|
||
beforeAll(() => { | ||
// mock Date.now | ||
mockNow(1570737000000); | ||
|
||
moment.tz.setDefault('America/Los_Angeles'); | ||
}); | ||
|
||
afterAll(() => moment.tz.setDefault('')); | ||
|
||
it('should render component with relative time in body and absolute time in tooltip', () => { | ||
expect(shallow(<TimestampTooltip time={timestamp} />)) | ||
.toMatchInlineSnapshot(` | ||
<EuiToolTip | ||
content="Oct 10, 2019, 08:06:40.123 (UTC-7)" | ||
delay="regular" | ||
position="top" | ||
> | ||
5 hours ago | ||
</EuiToolTip> | ||
`); | ||
}); | ||
|
||
it('should format with precision in milliseconds by default', () => { | ||
expect( | ||
shallow(<TimestampTooltip time={timestamp} />) | ||
.find('EuiToolTip') | ||
.prop('content') | ||
).toBe('Oct 10, 2019, 08:06:40.123 (UTC-7)'); | ||
}); | ||
|
||
it('should format with precision in seconds', () => { | ||
expect( | ||
shallow(<TimestampTooltip time={timestamp} timeUnit="seconds" />) | ||
.find('EuiToolTip') | ||
.prop('content') | ||
).toBe('Oct 10, 2019, 08:06:40 (UTC-7)'); | ||
}); | ||
|
||
it('should format with precision in minutes', () => { | ||
expect( | ||
shallow(<TimestampTooltip time={timestamp} timeUnit="minutes" />) | ||
.find('EuiToolTip') | ||
.prop('content') | ||
).toBe('Oct 10, 2019, 08:06 (UTC-7)'); | ||
}); | ||
}); |
108 changes: 0 additions & 108 deletions
108
x-pack/legacy/plugins/apm/public/components/shared/TimestampTooltip/index.test.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.