Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mletter1 committed Mar 26, 2020
1 parent 92c97ea commit e2dfdb3
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ module.exports = {
"^utils[/](.+)": "<rootDir>/web-server/utils/$1",
"^templates[/](.+)": "<rootDir>/web-server/__mocks__/fileMock.js",
// "^templates[/](.+)": "<rootDir>/web-server/templates/$1",
"^slycat-timeseries-model/plugin-components[/](.+)": "<rootDir>/web-server/plugins/slycat-timeseries-model/plugin-components/$1",

"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|html)$": "<rootDir>/web-server/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/web-server/__mocks__/styleMock.js",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import React from 'react';
import {
JobCodes
} from "slycat-timeseries-model/plugin-components/JobCodes.tsx";
import { mount } from "enzyme";


describe('Timeseries Jobcodes',() =>{
const render = mount(
<JobCodes/>
);
test('should match snapshot', () => {
expect(render).toMatchSnapshot();
});

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Timeseries Jobcodes should match snapshot 1`] = `
<JobCodes>
<div
className="collapse"
id="collapseExample"
>
<div
className="card card-body"
>
<dt>
JOB STATE CODES
</dt>
<dt>
BF BOOT_FAIL
</dt>
<dd>
Job terminated due to launch failure, typically due to a hardware failure (e.g. unable to boot the node or block and the job can not be requeued).
</dd>
<dt>
CA CANCELLED
</dt>
<dd>
Job was explicitly cancelled by the user or system administrator. The job may or may not have been initiated.
</dd>
<dt>
CD COMPLETED
</dt>
<dd>
Job has terminated all processes on all nodes with an exit code of zero.
</dd>
<dt>
DL DEADLINE
</dt>
<dd>
Job terminated on deadline.
</dd>
<dt>
F FAILED
</dt>
<dd>
Job terminated with non-zero exit code or other failure condition.
</dd>
<dt>
NF NODE_FAIL
</dt>
<dd>
Job terminated due to failure of one or more allocated nodes.
</dd>
<dt>
OOM OUT_OF_MEMORY
</dt>
<dd>
Job experienced out of memory error.
</dd>
<dt>
PD PENDING
</dt>
<dd>
Job is awaiting resource allocation.
</dd>
<dt>
PR PREEMPTED
</dt>
<dd>
Job terminated due to preemption.
</dd>
<dt>
R RUNNING
</dt>
<dd>
Job currently has an allocation.
</dd>
<dt>
RQ REQUEUED
</dt>
<dd>
Job was requeued.
</dd>
<dt>
RS RESIZING
</dt>
<dd>
Job is about to change size.
</dd>
<dt>
RV REVOKED
</dt>
<dd>
Sibling was removed from cluster due to other cluster starting the job.
</dd>
<dt>
S SUSPENDED
</dt>
<dd>
Job has an allocation, but execution has been suspended and CPUs have been released for other jobs.
</dd>
<dt>
TO TIMEOUT
</dt>
<dd>
Job terminated upon reaching its time limit.
</dd>
</div>
</div>
</JobCodes>
`;
2 changes: 1 addition & 1 deletion web-server/components/SearchWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class SearchWrapper extends React.Component<SearchWrapperProps, S
};
}

componentWillMount() {
componentDidMount() {
this.setState({items: this.state.initialItems});
}

Expand Down

0 comments on commit e2dfdb3

Please sign in to comment.