diff --git a/src/components/toolbar/__tests__/__snapshots__/toolbar.test.js.snap b/src/components/toolbar/__tests__/__snapshots__/toolbar.test.js.snap index cacd02dfa..fadfab502 100644 --- a/src/components/toolbar/__tests__/__snapshots__/toolbar.test.js.snap +++ b/src/components/toolbar/__tests__/__snapshots__/toolbar.test.js.snap @@ -1,370 +1,460 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Toolbar Component should handle adding and clearing filters from redux state: dispatch filter 1`] = ` -[MockFunction] { - "calls": Array [ +Array [ + Array [ + Object { + "data": Object { + "currentFilter": "sla", + }, + "type": "SET_FILTER_TYPE", + }, + ], + Array [ Array [ Object { "data": Object { - "currentFilter": "sla", + "activeFilters": Set { + "sla", + }, }, - "type": "SET_FILTER_TYPE", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "sla": "premium", + }, + "type": "SET_QUERY_SLA_RHSM", }, ], + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "activeFilters": Set { - "sla", - }, + Object { + "data": Object { + "activeFilters": Set { + "sla", }, - "type": "SET_ACTIVE_FILTERS", }, - Object { - "data": Object { - "sla": "premium", - }, - "type": "SET_QUERY_SLA_RHSM", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "sla": "standard", }, - ], + "type": "SET_QUERY_SLA_RHSM", + }, ], + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "activeFilters": Set { - "sla", - }, - }, - "type": "SET_ACTIVE_FILTERS", + Object { + "data": Object { + "activeFilters": Set {}, }, - Object { - "data": Object { - "sla": "standard", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, }, - "type": "SET_QUERY_SLA_RHSM", }, - ], + "type": "SET_QUERY_CLEAR", + }, ], + ], + Array [ + Object { + "data": Object { + "currentFilter": "usage", + }, + "type": "SET_FILTER_TYPE", + }, + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "currentFilter": null, - }, - "type": "SET_FILTER_TYPE", - }, - Object { - "data": Object { - "activeFilters": Set {}, + Object { + "data": Object { + "activeFilters": Set { + "usage", }, - "type": "SET_ACTIVE_FILTERS", }, - Object { - "data": Object { - "clearFilters": Object { - "sla": null, - }, - }, - "type": "SET_QUERY_CLEAR", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "usage": "Development/Test", }, - ], + "type": "SET_QUERY_USAGE_RHSM", + }, ], + ], + Array [ Array [ Object { "data": Object { - "currentFilter": "usage", + "activeFilters": Set { + "usage", + }, }, - "type": "SET_FILTER_TYPE", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "usage": "Disaster Recovery", + }, + "type": "SET_QUERY_USAGE_RHSM", }, ], + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "activeFilters": Set { - "usage", - }, - }, - "type": "SET_ACTIVE_FILTERS", + Object { + "data": Object { + "activeFilters": Set {}, }, - Object { - "data": Object { - "usage": "Development/Test", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "usage": null, }, - "type": "SET_QUERY_USAGE_RHSM", }, - ], + "type": "SET_QUERY_CLEAR", + }, ], + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "activeFilters": Set { - "usage", - }, - }, - "type": "SET_ACTIVE_FILTERS", + Object { + "data": Object { + "activeFilters": Set {}, }, - Object { - "data": Object { - "usage": "Disaster Recovery", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, + "usage": null, }, - "type": "SET_QUERY_USAGE_RHSM", }, - ], + "type": "SET_QUERY_CLEAR", + }, ], + ], +] +`; + +exports[`Toolbar Component should handle adding and clearing filters from redux state: dispatch filter, hard reset 1`] = ` +Array [ + Array [ + Object { + "data": Object { + "currentFilter": "sla", + }, + "type": "SET_FILTER_TYPE", + }, + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "currentFilter": null, + Object { + "data": Object { + "activeFilters": Set { + "sla", }, - "type": "SET_FILTER_TYPE", }, - Object { - "data": Object { - "activeFilters": Set {}, - }, - "type": "SET_ACTIVE_FILTERS", + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "sla": "premium", }, - Object { - "data": Object { - "clearFilters": Object { - "usage": null, - }, + "type": "SET_QUERY_SLA_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "sla", }, - "type": "SET_QUERY_CLEAR", }, - ], + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "sla": "standard", + }, + "type": "SET_QUERY_SLA_RHSM", + }, ], + ], + Array [ Array [ - Array [ - Object { - "data": Object { - "currentFilter": null, - }, - "type": "SET_FILTER_TYPE", + Object { + "data": Object { + "activeFilters": Set {}, }, - Object { - "data": Object { - "activeFilters": Set {}, - }, - "type": "SET_ACTIVE_FILTERS", - }, - Object { - "data": Object { - "clearFilters": Object { - "sla": null, - "usage": null, - }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, }, - "type": "SET_QUERY_CLEAR", }, - ], + "type": "SET_QUERY_CLEAR", + }, ], ], - "results": Array [ + Array [ Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Object { - "data": Object { - "currentFilter": "sla", - }, - "type": "SET_FILTER_TYPE", - }, + "data": Object { + "currentFilter": "usage", }, + "type": "SET_FILTER_TYPE", }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "activeFilters": Set { - "sla", - }, - }, - "type": "SET_ACTIVE_FILTERS", + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "usage", }, - Object { - "data": Object { - "sla": "premium", - }, - "type": "SET_QUERY_SLA_RHSM", + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "usage": "Development/Test", + }, + "type": "SET_QUERY_USAGE_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "usage", }, - ], + }, + "type": "SET_ACTIVE_FILTERS", }, - }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "activeFilters": Set { - "sla", - }, - }, - "type": "SET_ACTIVE_FILTERS", + Object { + "data": Object { + "usage": "Disaster Recovery", + }, + "type": "SET_QUERY_USAGE_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set {}, + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "usage": null, }, - Object { - "data": Object { - "sla": "standard", - }, - "type": "SET_QUERY_SLA_RHSM", + }, + "type": "SET_QUERY_CLEAR", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set {}, + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, + "usage": null, }, - ], + }, + "type": "SET_QUERY_CLEAR", }, - }, + ], + ], + Array [ Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "currentFilter": null, - }, - "type": "SET_FILTER_TYPE", - }, - Object { - "data": Object { - "activeFilters": Set {}, - }, - "type": "SET_ACTIVE_FILTERS", - }, - Object { - "data": Object { - "clearFilters": Object { - "sla": null, - }, - }, - "type": "SET_QUERY_CLEAR", - }, - ], + "data": Object { + "currentFilter": "sla", }, + "type": "SET_FILTER_TYPE", }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Object { - "data": Object { - "currentFilter": "usage", + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "sla", }, - "type": "SET_FILTER_TYPE", }, + "type": "SET_ACTIVE_FILTERS", }, - }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "activeFilters": Set { - "usage", - }, - }, - "type": "SET_ACTIVE_FILTERS", + Object { + "data": Object { + "sla": "premium", + }, + "type": "SET_QUERY_SLA_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "sla", }, - Object { - "data": Object { - "usage": "Development/Test", - }, - "type": "SET_QUERY_USAGE_RHSM", + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "sla": "standard", + }, + "type": "SET_QUERY_SLA_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set {}, + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, }, - ], + }, + "type": "SET_QUERY_CLEAR", }, - }, + Object { + "data": Object { + "currentFilter": null, + }, + "type": "SET_FILTER_TYPE", + }, + ], + ], + Array [ Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "activeFilters": Set { - "usage", - }, - }, - "type": "SET_ACTIVE_FILTERS", - }, - Object { - "data": Object { - "usage": "Disaster Recovery", - }, - "type": "SET_QUERY_USAGE_RHSM", - }, - ], + "data": Object { + "currentFilter": "usage", }, + "type": "SET_FILTER_TYPE", }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "currentFilter": null, - }, - "type": "SET_FILTER_TYPE", - }, - Object { - "data": Object { - "activeFilters": Set {}, - }, - "type": "SET_ACTIVE_FILTERS", - }, - Object { - "data": Object { - "clearFilters": Object { - "usage": null, - }, - }, - "type": "SET_QUERY_CLEAR", + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "usage", }, - ], + }, + "type": "SET_ACTIVE_FILTERS", }, - }, - Object { - "type": "return", - "value": Object { - "data": undefined, - "type": Array [ - Object { - "data": Object { - "currentFilter": null, - }, - "type": "SET_FILTER_TYPE", + Object { + "data": Object { + "usage": "Development/Test", + }, + "type": "SET_QUERY_USAGE_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set { + "usage", }, - Object { - "data": Object { - "activeFilters": Set {}, - }, - "type": "SET_ACTIVE_FILTERS", + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "usage": "Disaster Recovery", + }, + "type": "SET_QUERY_USAGE_RHSM", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set {}, + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "usage": null, }, - Object { - "data": Object { - "clearFilters": Object { - "sla": null, - "usage": null, - }, - }, - "type": "SET_QUERY_CLEAR", + }, + "type": "SET_QUERY_CLEAR", + }, + Object { + "data": Object { + "currentFilter": null, + }, + "type": "SET_FILTER_TYPE", + }, + ], + ], + Array [ + Array [ + Object { + "data": Object { + "activeFilters": Set {}, + }, + "type": "SET_ACTIVE_FILTERS", + }, + Object { + "data": Object { + "clearFilters": Object { + "sla": null, + "usage": null, }, - ], + }, + "type": "SET_QUERY_CLEAR", }, - }, + Object { + "data": Object { + "currentFilter": null, + }, + "type": "SET_FILTER_TYPE", + }, + ], ], -} +] `; exports[`Toolbar Component should render a non-connected component: non-connected 1`] = ` @@ -414,7 +504,11 @@ exports[`Toolbar Component should render a non-connected component: non-connecte ] } placeholder="t(curiosity-toolbar.categoryPlaceholder)" - selectedOptions={Array []} + selectedOptions={ + Array [ + "t(curiosity-toolbar.usageCategory)", + ] + } toggleIcon={