Improve test coverage

tests: Add test for updateCompose redux action
This commit is contained in:
Alexander Todorov 2020-11-05 11:40:04 +02:00 committed by GitHub
parent a77b248526
commit 56d3701962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View 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);
});
});