-
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.
[Uptime] [Test] Add functional test for monitor with location name bu…
…t no geo (#55915) * Add unit test for missing geo on named location. * WIP writing a functional test. * New named-location with no geo data test is functioning. * Update snaps for functional test attribute. * Rename test. * Remove unnecessary async syntax. * Delete unneeded symbols. * Remove unnecessary boolean conversion. * Fix typo in a comment.
- Loading branch information
1 parent
90ad260
commit e7899ff
Showing
8 changed files
with
137 additions
and
12 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...lic/components/functional/location_map/__tests__/__snapshots__/location_map.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...components/functional/location_map/__tests__/__snapshots__/location_missing.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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 { makeChecksWithStatus } from '../../../api_integration/apis/uptime/graphql/helpers/make_checks'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const pageObjects = getPageObjects(['uptime']); | ||
|
||
describe('location', () => { | ||
const start = new Date().toISOString(); | ||
const end = new Date().toISOString(); | ||
|
||
const MONITOR_ID = 'location-testing-id'; | ||
before(async () => { | ||
/** | ||
* This mogrify function will strip the documents of their location | ||
* data (but preserve their location name), which is necessary for | ||
* this test to work as desired. | ||
* @param d current document | ||
*/ | ||
const mogrifyNoLocation = (d: any) => { | ||
if (d.observer?.geo?.location) { | ||
d.observer.geo.location = undefined; | ||
} | ||
return d; | ||
}; | ||
await makeChecksWithStatus( | ||
getService('legacyEs'), | ||
MONITOR_ID, | ||
5, | ||
2, | ||
10000, | ||
{}, | ||
'up', | ||
mogrifyNoLocation | ||
); | ||
}); | ||
|
||
it('renders the location missing popover when monitor has location name, but no geo data', async () => { | ||
await pageObjects.uptime.loadDataAndGoToMonitorPage(start, end, MONITOR_ID); | ||
await pageObjects.uptime.locationMissingIsDisplayed(); | ||
}); | ||
}); | ||
}; |
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