-
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.
Display APM server memory in bytes (#54275)
* Display APM server memory in bytes * Add tests for helpers
- Loading branch information
Showing
5 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...onitoring/public/components/cluster/overview/__tests__/__snapshots__/helpers.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...ck/legacy/plugins/monitoring/public/components/cluster/overview/__tests__/helpers.test.js
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,42 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { renderWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; | ||
import { BytesUsage, BytesPercentageUsage } from '../helpers'; | ||
|
||
describe('Bytes Usage', () => { | ||
it('should format correctly with used and max bytes', () => { | ||
const props = { | ||
usedBytes: 50, | ||
maxBytes: 100, | ||
}; | ||
expect(renderWithIntl(<BytesUsage {...props} />)).toMatchSnapshot(); | ||
}); | ||
|
||
it('should format correctly with only usedBytes', () => { | ||
const props = { | ||
usedBytes: 50, | ||
}; | ||
expect(renderWithIntl(<BytesUsage {...props} />)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe('BytesPercentageUsage', () => { | ||
it('should format correctly with used bytes and max bytes', () => { | ||
const props = { | ||
usedBytes: 50, | ||
maxBytes: 100, | ||
}; | ||
expect(renderWithIntl(<BytesPercentageUsage {...props} />)).toMatchSnapshot(); | ||
}); | ||
it('should return zero bytes if both parameters are not present', () => { | ||
const props = { | ||
usedBytes: 50, | ||
}; | ||
expect(renderWithIntl(<BytesPercentageUsage {...props} />)).toMatchSnapshot(); | ||
}); | ||
}); |
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