Skip to content
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

Metrics with status unknown in the details view of the 'Metrics' metr… #937

Merged
merged 4 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/frontend/package-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# README package.json

The package.json contain a devDependency for @babel/core to prevent memory problems when running the front end unit tests on CircleCI. See this issue: https://github.com/facebook/create-react-app/issues/8096.

236 changes: 217 additions & 19 deletions components/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion components/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"devDependencies": {
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"react-test-renderer": "^16.12.0"
"react-test-renderer": "^16.12.0",
"@babel/core": "^7.7.7"
}
}
16 changes: 8 additions & 8 deletions components/frontend/src/metric/StatusIcon.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { Icon } from 'semantic-ui-react';

export function StatusIcon({ status}) {
const status_icon = {
target_met: 'check', near_target_met: 'warning', debt_target_met: 'money',
target_not_met: 'x', null: 'question'
}[status];
return (
<Icon size='large' name={status_icon} />
)
export function StatusIcon({ status }) {
const status_icon = {
target_met: 'check', near_target_met: 'warning', debt_target_met: 'money',
target_not_met: 'x', null: 'question'
}[status || null];
return (
<Icon size='large' name={status_icon} />
)
}
17 changes: 11 additions & 6 deletions components/frontend/src/metric/StatusIcon.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { mount } from 'enzyme';
import { StatusIcon } from './StatusIcon';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<StatusIcon status="target_met" />, div);
ReactDOM.unmountComponentAtNode(div);
});
describe('<StatusIcon/>' , () => {
it('renders a checkmark if the status is target_met', () => {
const wrapper = mount(<StatusIcon status="target_met" />);
expect(wrapper.find("Icon").prop("name")).toBe("check");
})
it('renders a question mark if the status is missing', () => {
const wrapper = mount(<StatusIcon/>);
expect(wrapper.find("Icon").prop("name")).toBe("question");
})
})
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix Checkmarx landing url. Fixes [#919](https://github.com/ICTU/quality-time/issues/919).
- Remove plaintext passwords from HTML. Fixes [#921](https://github.com/ICTU/quality-time/issues/921).
- Remove private tokens from URLs logged by the collector. Fixes [#934](https://github.com/ICTU/quality-time/issues/934).
- Metrics with status unknown in the details view of the 'Metrics' metric did not show a question mark. Fixes [#935](https://github.com/ICTU/quality-time/issues/935).

## [1.2.0] - [2019-12-10]

Expand Down