Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Nov 6, 2023
1 parent e3a63a2 commit 3f89948
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("MenuOptionSelectionAll", () => {
it("renders", () => {
render(
<MenuOptionSelectionAll
select={[]}
select={["test"]}
state={{} as any}
allSelection={() => {}}
/>
Expand All @@ -15,7 +15,7 @@ describe("MenuOptionSelectionAll", () => {
it("renders 2", () => {
render(
<MenuOptionSelectionAll
select={[]}
select={["test"]}
state={
{
fileIndexItems: []
Expand All @@ -30,7 +30,7 @@ describe("MenuOptionSelectionAll", () => {
const allSelection = jest.fn();
const component = render(
<MenuOptionSelectionAll
select={[]}
select={["test"]}
state={
{
fileIndexItems: []
Expand All @@ -39,7 +39,6 @@ describe("MenuOptionSelectionAll", () => {
allSelection={allSelection}
/>
);
console.log(component.container.innerHTML);

const allItem = component.queryByTestId("select-all") as HTMLElement;
expect(allItem).toBeTruthy();
Expand All @@ -55,7 +54,7 @@ describe("MenuOptionSelectionAll", () => {
const allSelection = jest.fn();
const component = render(
<MenuOptionSelectionAll
select={[]}
select={["test"]}
state={
{
fileIndexItems: []
Expand All @@ -65,10 +64,9 @@ describe("MenuOptionSelectionAll", () => {
/>
);

fireEvent.keyDown(
component.queryByTestId("undo-selection") as HTMLElement,
{ key: "Enter" }
);
fireEvent.keyDown(component.queryByTestId("select-all") as HTMLElement, {
key: "Enter"
});

expect(allSelection).toBeCalledTimes(1);
});
Expand Down

0 comments on commit 3f89948

Please sign in to comment.