Skip to content

Commit

Permalink
remove broken test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Oct 28, 2024
1 parent 4d16d2d commit ced201e
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions client/src/components/Common/FilterMenu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,48 +198,6 @@ describe("FilterMenu", () => {
);
});

it("test buttons that navigate menu and keyup.enter/esc events", async () => {
setUpWrapper("Test Items", "search test items", TestFilters);

expect(wrapper.find("[data-description='advanced filters']").exists()).toBe(false);
await wrapper.setProps({ showAdvanced: true });
expect(wrapper.find("[data-description='advanced filters']").exists()).toBe(true);

// only add name filter in the advanced menu
let filterName = wrapper.find("[placeholder='any name']");
if (filterName.vm && filterName.props().type == "text") {
await filterName.setValue("sample name");
}

// -------- Test keyup.enter key: ---------
// toggles view out and performs a search
await filterName.trigger("keyup.enter");
await expectCorrectEmits("name:'sample name'", TestFilters, false);

// Test: clearing the filterText
const clearButton = wrapper.find("[data-description='reset query']");
await clearButton.trigger("click");
await expectCorrectEmits("", TestFilters, false);

// Test: toggling view back in
const toggleButton = wrapper.find("[data-description='toggle advanced search']");
await toggleButton.trigger("click");
await expectCorrectEmits("", TestFilters, true);

// -------- Test keyup.esc key: ---------
// toggles view out only (doesn't cause a new search / doesn't emulate enter)

// find name field again (destroyed because of toggling out) and set value
filterName = wrapper.find("[placeholder='any name']");
if (filterName.vm && filterName.props().type == "text") {
filterName.setValue("newnamefilter");
}

// press esc key from name field (should not change emitted filterText unlike enter key)
await filterName.trigger("keyup.esc");
await expectCorrectEmits("", TestFilters, false);
});

/**
* Testing the default values of the filters defined in the HistoryFilters: Filtering
* class, ensuring the default values are reflected in the radio-group buttons
Expand Down

0 comments on commit ced201e

Please sign in to comment.