debian-image-builder-frontend/src/test/SmartComponents/redux/actions.test.js
Sanne Raymaekers abb3bbc868 test: Make sure the status of a compose is called status
This was a bit confusing because in the inline documentation, I wrote
that a compose used state as a key. However this changed to status
pretty early on and I forgot to update it.

Also use an actual uuid with proper length.
2020-11-10 12:34:30 +02:00

22 lines
657 B
JavaScript

import actions from '../../../SmartComponents/redux/actions';
import types from '../../../SmartComponents/redux/types';
const compose = {
'77e4c693-0497-4b85-936d-b2a3ad69571b': {
status: '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);
});
});