Skip to content

Commit

Permalink
fix console manager test
Browse files Browse the repository at this point in the history
  • Loading branch information
eokoneyo committed Nov 6, 2024
1 parent 8a9f50a commit 21c7e82
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,19 @@ describe('When using ConsoleManager', () => {
renderResult.result.current.show(consoleId);
});

expect(renderResult.result.current.getOne(consoleId)!.isVisible()).toBe(true);
let consoleLine: ReturnType<ConsoleManagerClient['getOne']>;

act(() => {
consoleLine = renderResult.result.current.getOne(consoleId);
});

expect(consoleLine!.isVisible()).toBe(true);

act(() => {
renderResult.result.current.hide(consoleId);
});

expect(renderResult.result.current.getOne(consoleId)!.isVisible()).toBe(false);
expect(consoleLine!.isVisible()).toBe(false);
});

it('should throw if attempting to hide a console with invalid `id`', () => {
Expand Down

0 comments on commit 21c7e82

Please sign in to comment.