From 27220ee13326900bcf560b69ef1946a0f4b4c254 Mon Sep 17 00:00:00 2001 From: Pokey Rule <755842+pokey@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:25:57 -0700 Subject: [PATCH] Attempt to make tutorial test more robust (#2601) ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet --- .../src/suite/tutorial/tutorial.vscode.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts index 09d807dd32..c1e775e925 100644 --- a/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts @@ -156,13 +156,12 @@ async function runBasicTutorialTest(spyIde: SpyIDE) { // Another sleep just in case await sleepWithBackoff(50); - // We allow duplicate messages because they're idempotent. Not sure why some - // platforms get the init message twice but it doesn't matter. - const log = getTutorialWebviewEventLog(); - const lastMessage = log[log.length - 1]; assert( - lastMessage.type === "messageSent" && - lastMessage.data.preConditionsMet === false, + getTutorialWebviewEventLog().some( + (message) => + message.type === "messageSent" && + message.data.preConditionsMet === false, + ), ); // Test resuming tutorial