4cb0505cbd71
replace flushView+assert with vi.waitFor in TOTP copy test — 220ms click timer outlasts 0ms flush
- time
- 2026-05-15 17:57 UTC · 5 months ago
- machine
- koh2
- parent
- d6b451606313
↓ peach-browser-4cb0505c.tar.gzatlas at this save
files changed1 file
src/popup/views/contracts.test.tsx+6 −5src/popup/views/contracts.test.tsx+6 −5
@@ -511,12 +511,13 @@511511 512512 const totpMain = container.querySelector(".peach-totp-main") as HTMLDivElement;513513 totpMain.click();514- await flushView();515514 516- expect(sendMessageMock).toHaveBeenLastCalledWith({517- type: "COPY",518- payload: { text: "123456", label: "totp", alreadyWritten: false },519- });515+ await vi.waitFor(() => {516+ expect(sendMessageMock).toHaveBeenLastCalledWith({517+ type: "COPY",518+ payload: { text: "123456", label: "totp", alreadyWritten: false },519+ });520+ }, { timeout: 500 });520521 });521522 522523 it("Entry closes an unchanged inline editor when focus leaves it", async () => {