Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.33",
"openstack-uicore-foundation": "5.0.35",
"openstack-uicore-foundation": "5.0.36-beta.2",
"p-limit": "^6.1.0",
"path-browserify": "^1.0.1",
"postcss-loader": "^6.2.1",
Expand All @@ -114,7 +114,7 @@
"react-dropzone": "^4.2.13",
"react-final-form": "^6.5.9",
"react-google-maps": "^9.4.5",
"react-redux": "^5.0.7",
"react-redux": "^7.1.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-rte": "^0.16.3",
Expand All @@ -124,7 +124,7 @@
"react-switch": "^6.0.0",
"react-tooltip": "^5.28.0",
"react-window": "^1.8.10",
"redux": "^3.7.2",
"redux": "^4.2.1",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"segmented-control": "0.1.12",
Expand Down
11 changes: 4 additions & 7 deletions src/actions/__tests__/event-actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("Event Actions", () => {
capturedParams = null;
});

test("builds speakers_count between filter using [] syntax", async () => {
test("passes pre-built [] range filter strings through to the request", async () => {
const store = mockStore({
currentSummitState: {
currentSummit: {
Expand All @@ -63,15 +63,14 @@ describe("Event Actions", () => {
});

store.dispatch(
getEvents(null, 1, 10, "id", 1, { speakers_count_filter: [1, 3] }, [])
getEvents(null, 1, 10, "id", 1, ["speakers_count[]1&&3"], [])
);

await flushPromises();

expect(getRequest).toHaveBeenCalledTimes(1);
expect(capturedParams).toBeTruthy();
expect(capturedParams["filter[]"]).toContain("speakers_count[]1&&3");
expect(capturedParams["filter[]"]).not.toContain("speakers_count[]]1&&3");
});

test("requests type.use_speakers in fields for event list", async () => {
Expand All @@ -93,7 +92,7 @@ describe("Event Actions", () => {
expect(capturedParams.fields).toContain("type.use_speakers");
});

test("builds speakers_count operator filter when value is not an array", async () => {
test("passes pre-built operator filter strings through to the request", async () => {
const store = mockStore({
currentSummitState: {
currentSummit: {
Expand All @@ -103,9 +102,7 @@ describe("Event Actions", () => {
}
});

store.dispatch(
getEvents(null, 1, 10, "id", 1, { speakers_count_filter: ">=2" }, [])
);
store.dispatch(getEvents(null, 1, 10, "id", 1, ["speakers_count>=2"], []));

await flushPromises();

Expand Down
Loading
Loading