From e3735311ab957342eaae8b51f1a3b4dc7df1cee2 Mon Sep 17 00:00:00 2001 From: James Salter Date: Mon, 25 Apr 2022 17:52:50 +0100 Subject: [PATCH] Check updated is === the new version in accordance with new behaviour (#8407) --- test/end-to-end-tests/src/scenarios/update.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/end-to-end-tests/src/scenarios/update.ts b/test/end-to-end-tests/src/scenarios/update.ts index 0e6b08f89a..30d21c5feb 100644 --- a/test/end-to-end-tests/src/scenarios/update.ts +++ b/test/end-to-end-tests/src/scenarios/update.ts @@ -19,6 +19,8 @@ import { strict as assert } from 'assert'; import { ElementSession } from "../session"; +const NEW_VERSION = "some-new-version"; + async function mockVersionHTTPResponse(session: ElementSession) { // Mock the HTTP response to return a new version to trigger auto-update behaviour await session.page.setRequestInterception(true); @@ -29,7 +31,7 @@ async function mockVersionHTTPResponse(session: ElementSession) { request.respond({ contentType: "text/html", status: 200, - body: "some-new-version", + body: NEW_VERSION, }); } else { request.continue(); @@ -43,5 +45,5 @@ export async function updateScenarios(session: ElementSession) { await session.goto(session.url('/')); await session.waitForReload(); const newUrl = new URL(session.page.url()); - assert.equal(newUrl.searchParams.get("updated"), "1"); + assert.equal(newUrl.searchParams.get("updated"), NEW_VERSION); }