Skip to content

Commit

Permalink
fix(gui): use correct error-patterns in gui-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Ksirov committed Dec 16, 2019
1 parent 8bd8302 commit 2915fd8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/static/modules/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ function reducer(state = getInitialState(compiledData), action) {
skips,
apiValues,
saveFormat,
config: {scaleImages, lazyLoadOffset}
config
} = action.payload;
const {errorPatterns} = state.config;
const {scaleImages, lazyLoadOffset, errorPatterns} = config;
const {filteredBrowsers, testNameFilter, viewMode} = state.view;

const formattedSuites = formatSuitesData(filterSuites(suites, filteredBrowsers));
Expand All @@ -100,6 +100,7 @@ function reducer(state = getInitialState(compiledData), action) {
{},
state,
{
config,
gui,
autoRun,
skips,
Expand Down
17 changes: 17 additions & 0 deletions test/unit/lib/static/modules/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ describe('lib/static/modules/reducer', () => {
});
});

describe('VIEW_INITIAL', () => {
it('should take error patterns from config', () => {
const action = {
type: actionNames.VIEW_INITIAL,
payload: {
config: {
errorPatterns: [{name: 'err1', pattern: 'pattern1'}]
}
}
};

const newState = reducer(defaultState, action);

assert.deepEqual(newState.config.errorPatterns, [{name: 'err1', pattern: 'pattern1'}]);
});
});

describe('VIEW_SHOW_ALL', () => {
it('should change "viewMode" field on "all" value', () => {
const action = {type: actionNames.VIEW_SHOW_ALL};
Expand Down

0 comments on commit 2915fd8

Please sign in to comment.