Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth committed Aug 23, 2023
1 parent 52f7ca9 commit ea4a605
Showing 1 changed file with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test("renders object", async () => {
})
})

test("renders not option", async () => {
test("renders not operator", async () => {
const user = userEvent.setup()

const operator = {
Expand Down Expand Up @@ -128,3 +128,50 @@ test("renders not option", async () => {
await user.keyboard("{escape}")
})
})

test("renders not option", async () => {
const user = userEvent.setup()

const operator = {
value: "equals",
label: "Equals",
options: [
{ value: "test", label: "Test" },
{ value: "test2", label: "Test 2" },
],
}

const props = {
field: {
value: "name",
label: "Name",
operators: [operator],
},
operator,
filter: {
type: "table",
field: "name",
operator: "equals",
value: "test3",
},
setFilter: () => {},
onClose: () => {},
}

render(<ValueField {...props} />, {
path: ":organisationName/:workspaceName/graph",
route: "/default/demo/graph",
})

await waitFor(() => {
expect(screen.getByText("Test")).toBeInTheDocument()
})

await waitFor(() => {
expect(screen.getByText("Test 2")).toBeInTheDocument()
})

await act(async () => {
await user.keyboard("{escape}")
})
})

0 comments on commit ea4a605

Please sign in to comment.