Improve test coverage
tests: Add test for updateCompose redux action
This commit is contained in:
parent
a77b248526
commit
56d3701962
2 changed files with 24 additions and 1 deletions
22
src/test/SmartComponents/redux/actions.test.js
Normal file
22
src/test/SmartComponents/redux/actions.test.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import actions from '../../../SmartComponents/redux/actions';
|
||||
import types from '../../../SmartComponents/redux/types';
|
||||
|
||||
const compose = {
|
||||
'xxxx-xxxx-xxxx-xxxx': {
|
||||
state: 'uploading',
|
||||
distribution: 'fedora-31',
|
||||
architecture: 'x86_64',
|
||||
image_type: 'qcow2'
|
||||
}
|
||||
};
|
||||
|
||||
describe('updateCompose', () => {
|
||||
test('returns dict', () => {
|
||||
const result = actions.updateCompose(compose);
|
||||
|
||||
// this function updates the type attribute and
|
||||
// returns everything else unchanged
|
||||
expect(result.type).toBe(types.UPDATE_COMPOSE);
|
||||
expect(result.compose).toBe(compose);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue