From 380c263d6ee292e01fca47ecf0edddc1321e3299 Mon Sep 17 00:00:00 2001 From: PanSpagetka Date: Tue, 11 Jun 2019 10:31:42 +0200 Subject: [PATCH] Fix specs for Provision taggiing middleware --- app/javascript/spec/miq-redux/middleware.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/spec/miq-redux/middleware.spec.js b/app/javascript/spec/miq-redux/middleware.spec.js index 19e1c164daaa..3a15710216e0 100644 --- a/app/javascript/spec/miq-redux/middleware.spec.js +++ b/app/javascript/spec/miq-redux/middleware.spec.js @@ -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});