Skip to content

Commit

Permalink
Fix specs for Provision taggiing middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Jun 11, 2019
1 parent e9fd1d4 commit 380c263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/javascript/spec/miq-redux/middleware.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ it('calls post for UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE action', () =>
getState: () => ({
tagging: {
appState: {
affectedItems: [{}]
affectedItems: [{}],
assignedTags: []
}
}
})
};
const action = { type: 'UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE', meta: { url: 'url/bla' }, tag: {tagCategory: {id: 1}, tagValue: { id:2 }}}
const action = { type: 'UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE', meta: { url: 'url/bla', params: jest.fn() }, tag: {tagCategory: {id: 1}, tagValue: { id:2 }}}
taggingMiddleware(store)(next)(action);
expect(next.mock.calls).toEqual( [[{"meta": {"url": "url/bla"}, "tag": {"tagCategory": {"id": 1}, "tagValue": {"id": 2}}, "type": "UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE"}]]);
expect(spy).toHaveBeenCalledWith("url/bla", {"cat": 1, "check": 1, "id": {}, "tree_typ": "tags", "val": 2});
Expand Down

0 comments on commit 380c263

Please sign in to comment.