Skip to content

Commit

Permalink
Redux test
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Oct 22, 2023
1 parent 4d369b4 commit eba6eb1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions web/src/redux.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
ACTION_FLUX_STATE_RECEIVED,
initialState,
rootReducer
} from './redux';

function deepCopy(toCopy) {
return JSON.parse(JSON.stringify(toCopy));
}

test('should store flux state', () => {
const fluxState = {
type: ACTION_FLUX_STATE_RECEIVED,
payload: {
gitRepositories: [{}, {}],
kustomizations: [],
}
};

let reduced = rootReducer(initialState, fluxState);

expect(reduced.fluxState.gitRepositories.length).toEqual(2);
});

0 comments on commit eba6eb1

Please sign in to comment.