You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-06 10:22:45 +03:00
Check updated is === the new version in accordance with new behaviour (#8407)
This commit is contained in:
@@ -19,6 +19,8 @@ import { strict as assert } from 'assert';
|
|||||||
|
|
||||||
import { ElementSession } from "../session";
|
import { ElementSession } from "../session";
|
||||||
|
|
||||||
|
const NEW_VERSION = "some-new-version";
|
||||||
|
|
||||||
async function mockVersionHTTPResponse(session: ElementSession) {
|
async function mockVersionHTTPResponse(session: ElementSession) {
|
||||||
// Mock the HTTP response to return a new version to trigger auto-update behaviour
|
// Mock the HTTP response to return a new version to trigger auto-update behaviour
|
||||||
await session.page.setRequestInterception(true);
|
await session.page.setRequestInterception(true);
|
||||||
@@ -29,7 +31,7 @@ async function mockVersionHTTPResponse(session: ElementSession) {
|
|||||||
request.respond({
|
request.respond({
|
||||||
contentType: "text/html",
|
contentType: "text/html",
|
||||||
status: 200,
|
status: 200,
|
||||||
body: "some-new-version",
|
body: NEW_VERSION,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
request.continue();
|
request.continue();
|
||||||
@@ -43,5 +45,5 @@ export async function updateScenarios(session: ElementSession) {
|
|||||||
await session.goto(session.url('/'));
|
await session.goto(session.url('/'));
|
||||||
await session.waitForReload();
|
await session.waitForReload();
|
||||||
const newUrl = new URL(session.page.url());
|
const newUrl = new URL(session.page.url());
|
||||||
assert.equal(newUrl.searchParams.get("updated"), "1");
|
assert.equal(newUrl.searchParams.get("updated"), NEW_VERSION);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user