Skip to content

Commit c2825c7

Browse files
committed
test(web): follow browser-test setup conventions in question panel tests
1 parent af89b53 commit c2825c7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.layout.browser.test.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ async function renderPanel(
7373
/>
7474
</ComposerBanner.Root>
7575
);
76+
// router: false because the pending-input panel never navigates.
7677
await using screen = await render(panel({}), { container, router: false });
7778
await run(container, (answers) => screen.rerender(panel(answers)));
7879
}

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.navigation.browser.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ function pressKey(key: string) {
9090
}
9191

9292
it("swaps the chosen option's number for a check in place and restores it when the choice moves", async () => {
93-
using _timers = fakeTimers();
9493
const options = [
9594
{ label: "Rolling", description: "One node at a time" },
9695
{ label: "Canary", description: "A slice of traffic first" },
@@ -104,6 +103,7 @@ it("swaps the chosen option's number for a check in place and restores it when t
104103
],
105104
};
106105
await using screen = await render(<Questions prompt={choicePrompt} />);
106+
using _timers = fakeTimers();
107107
const keys = () => optionKeys(screen.container);
108108
const activeIndex = () => screen.container.querySelector("output")!.textContent;
109109
const unpressed = [
@@ -148,7 +148,6 @@ it("swaps the chosen option's number for a check in place and restores it when t
148148
});
149149

150150
it("does not select or advance from a custom-answer hint", async () => {
151-
using _timers = fakeTimers();
152151
const prompt: PendingUserInput = {
153152
...defaultPrompt,
154153
questions: [
@@ -167,6 +166,7 @@ it("does not select or advance from a custom-answer hint", async () => {
167166
],
168167
};
169168
await using screen = await render(<Questions prompt={prompt} />);
169+
using _timers = fakeTimers();
170170
const keys = () => optionKeys(screen.container);
171171
const activeIndex = () => screen.container.querySelector("output")!.textContent;
172172
const unpressed = [

0 commit comments

Comments
 (0)