-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uptime] Add functional test to cover more filter functionality #56794
Closed
justinkambic
wants to merge
13
commits into
elastic:master
from
justinkambic:uptime_functional-test-filter-snapshot
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5ea7897
Add functional test to ensure filters don't break the snapshot compon…
justinkambic 21d41de
Fix test assertion.
justinkambic 38aa518
Add functional test to ensure filters don't break the snapshot compon…
justinkambic 08a35f4
Fix test assertion.
justinkambic 6952a02
Add aria-label prop to Chart Wrapper component.
justinkambic 98923d4
Add aria-label generator function for histogram component.
justinkambic 0828873
Update functional test to check aria label for snapshot verification.
justinkambic 3b3462a
Remove unnecessary prop.
justinkambic 1c8e88b
Merge branch 'master' into uptime_functional-test-filter-snapshot
justinkambic 83405b2
Merge branch 'uptime_functional-test-filter-snapshot' of github.com:j…
justinkambic 0a3f970
Extract repeated hardcoded value to a symbol.
justinkambic fbec6b8
Simplify functional test check.
justinkambic f92a34c
Merge branch 'master' into uptime_functional-test-filter-snapshot
justinkambic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
.../public/components/functional/charts/__tests__/__snapshots__/ping_histogram.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...ins/uptime/public/components/functional/charts/__tests__/get_histogram_aria_label.test.ts
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,43 @@ | ||
/* | ||
* 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 { HistogramDataPoint } from '../../../../../common/types'; | ||
import { getHistogramAriaLabelData } from '../ping_histogram'; | ||
|
||
describe('getHistogramAriaLabelData', () => { | ||
it('creates expected object from array', () => { | ||
const dataPoints: HistogramDataPoint[] = [ | ||
{ | ||
x: 1581022144000, | ||
downCount: 3, | ||
upCount: 2, | ||
}, | ||
{ | ||
x: 1581022174000, | ||
downCount: 4, | ||
upCount: 0, | ||
}, | ||
{ | ||
x: 1581022204000, | ||
downCount: 3, | ||
upCount: 1, | ||
}, | ||
]; | ||
|
||
expect(getHistogramAriaLabelData(dataPoints)).toEqual({ | ||
max: 5, | ||
maxDownCount: 3, | ||
maxTimestamp: 1581022144000, | ||
maxUpCount: 2, | ||
latestDownCount: 3, | ||
latestMax: 4, | ||
latestUpCount: 1, | ||
latestTimestamp: 1581022204000, | ||
totalDown: 10, | ||
totalUp: 3, | ||
}); | ||
}); | ||
}); |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any sort of test we could do on the ping histogram to catch breakage there? Looking around I don't see anything super obvious to hook into.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 6952a02, 98923d4, 0828873, and 3b3462a.