diff --git a/src/Components/Grid/Status.css b/src/Components/Grid/Status.css new file mode 100644 index 0000000..f37a390 --- /dev/null +++ b/src/Components/Grid/Status.css @@ -0,0 +1,18 @@ +.statusicon { + vertical-align: text-bottom; +} + +.passed { + color: green; +} + +.failed { + color: red; +} +.pending { + color: orange; +} + +.todo { + color: gray; +} diff --git a/src/Components/Grid/Status.js b/src/Components/Grid/Status.js new file mode 100644 index 0000000..9a0957d --- /dev/null +++ b/src/Components/Grid/Status.js @@ -0,0 +1,106 @@ +import React, { Component, Fragment } from 'react'; +import './Status.css'; +import PropTypes from 'prop-types'; +class Status extends Component { + render() { + if (this.props.status === 'passed') { + return ( + + + + + + + {this.props.status} + + ); + } else if (this.props.status === 'failed') { + return ( + + + + + + + {this.props.status} + + ); + } else if (this.props.status === 'pending') { + return ( + + + + + {this.props.status} + + ); + } else if (this.props.status === 'todo') { + return ( + + + + + {this.props.status} + + ); + } else { + return {this.props.status}; + } + } +} +Status.propTypes = { + status: PropTypes.string.isRequired, +}; +export default Status; diff --git a/src/Components/Grid/Status.test.js b/src/Components/Grid/Status.test.js new file mode 100644 index 0000000..dcedbc8 --- /dev/null +++ b/src/Components/Grid/Status.test.js @@ -0,0 +1,23 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import Status from './Status'; +test('Should contain passed', () => { + const { container } = render(); + expect(container.textContent).toEqual('passed'); + expect(container).toMatchSnapshot(); +}); +test('Should contain failed', () => { + const { container } = render(); + expect(container.textContent).toEqual('failed'); + expect(container).toMatchSnapshot(); +}); +test('Should contain pending', () => { + const { container } = render(); + expect(container.textContent).toEqual('pending'); + expect(container).toMatchSnapshot(); +}); +test('Should contain todo', () => { + const { container } = render(); + expect(container.textContent).toEqual('todo'); + expect(container).toMatchSnapshot(); +}); diff --git a/src/Components/Grid/TabContent.css b/src/Components/Grid/TabContent.css index d3aebea..dfcb88e 100644 --- a/src/Components/Grid/TabContent.css +++ b/src/Components/Grid/TabContent.css @@ -1,9 +1,17 @@ -.informationicon{ +.informationiconwrapper { cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 10%; box-shadow: 1px -1px #fafafa inset; + color: black; } +.informationicon { + vertical-align: text-bottom; +} + +.status { + text-transform: capitalize; +} diff --git a/src/Components/Grid/TabContent.js b/src/Components/Grid/TabContent.js index 9384536..5d32636 100644 --- a/src/Components/Grid/TabContent.js +++ b/src/Components/Grid/TabContent.js @@ -4,6 +4,7 @@ import './TabContent.css'; import TabHeading from './TabHeading'; import PropTypes from 'prop-types'; import DateUtilities from './../../Utilities/DateUtilities'; +import Status from './Status'; class TabContent extends Component { formatTime(value) { return new DateUtilities().convertMillisecondsToTime(value); @@ -26,27 +27,28 @@ class TabContent extends Component {
{this.props.item.title}
-
- {this.props.item.status} +
+
{this.formatTime(this.props.item?.duration)}
this.props.onShowModel(this.props.item) } > diff --git a/src/Components/Grid/TabContent.test.js b/src/Components/Grid/TabContent.test.js index f01039d..0c85c8e 100644 --- a/src/Components/Grid/TabContent.test.js +++ b/src/Components/Grid/TabContent.test.js @@ -1,4 +1,3 @@ -import '@testing-library/jest-dom'; import React from 'react'; import TabContent from './TabContent'; import { render, fireEvent } from '@testing-library/react'; diff --git a/src/Components/Grid/__snapshots__/Status.test.js.snap b/src/Components/Grid/__snapshots__/Status.test.js.snap new file mode 100644 index 0000000..84a44a3 --- /dev/null +++ b/src/Components/Grid/__snapshots__/Status.test.js.snap @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Should contain failed 1`] = ` +
+ + + + + + failed +
+`; + +exports[`Should contain passed 1`] = ` +
+ + + + + + passed +
+`; + +exports[`Should contain pending 1`] = ` +
+ + + + pending +
+`; + +exports[`Should contain todo 1`] = ` +
+ + + + todo +
+`; diff --git a/src/__snapshots__/App.test.js.snap b/src/__snapshots__/App.test.js.snap index 21d77e6..dc9f16d 100644 --- a/src/__snapshots__/App.test.js.snap +++ b/src/__snapshots__/App.test.js.snap @@ -255,8 +255,25 @@ exports[`Tree click Should call function on tree node click 1`] = ` should pass
+ + + + + passed
+ + + + + passed
+ + + + + passed
+ + + + + failed
+ + + + + passed
+ + + + + passed
+ + + + + failed
+ + + + + passed
+ + + + + passed