From 2dad878fcc000a743304d12f8033f722912ecec8 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 18 Feb 2022 17:03:19 +0000 Subject: [PATCH] fmt --- test/e2e/codeServer.test.ts | 2 +- test/e2e/models/CodeServer.ts | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/test/e2e/codeServer.test.ts b/test/e2e/codeServer.test.ts index 6a7d1ec1..349e106f 100644 --- a/test/e2e/codeServer.test.ts +++ b/test/e2e/codeServer.test.ts @@ -1,5 +1,5 @@ -import * as path from "path" import { promises as fs } from "fs" +import * as path from "path" import { describe, test, expect } from "./baseFixture" describe("CodeServer", true, [], () => { diff --git a/test/e2e/models/CodeServer.ts b/test/e2e/models/CodeServer.ts index f81d9ed3..4f37cbfe 100644 --- a/test/e2e/models/CodeServer.ts +++ b/test/e2e/models/CodeServer.ts @@ -205,7 +205,7 @@ export class CodeServerPage { /** * Navigate to a code-server endpoint. By default go to the root. */ - async navigate(path: string = "/") { + async navigate(path = "/") { const to = new URL(path, await this.codeServer.address()) await this.page.goto(to.toString(), { waitUntil: "networkidle" }) } @@ -360,10 +360,12 @@ export class CodeServerPage { * try again. */ const navigate = async (ctx: Context) => { - const steps: Array<{fn: () => Promise, name: string}> = [{ - fn: () => this.page.waitForSelector(`${selector}:focus-within`), - name: "focus", - }] + const steps: Array<{ fn: () => Promise; name: string }> = [ + { + fn: () => this.page.waitForSelector(`${selector}:focus-within`), + name: "focus", + }, + ] for (const item of items) { // Normally these will wait for the item to be visible and then execute @@ -373,10 +375,22 @@ export class CodeServerPage { // if the old promise clicks logout before the new one can). By // splitting them into two steps each we can cancel before running the // action. - steps.push({fn: () => this.page.hover(`${selector} :text("${item}")`, { trial: true }), name: `${item}:hover:trial`}) - steps.push({fn: () => this.page.hover(`${selector} :text("${item}")`, { force: true }), name: `${item}:hover:force`}) - steps.push({fn: () => this.page.click(`${selector} :text("${item}")`, { trial: true }), name: `${item}:click:trial`}) - steps.push({fn: () => this.page.click(`${selector} :text("${item}")`, { force: true }), name: `${item}:click:force`}) + steps.push({ + fn: () => this.page.hover(`${selector} :text("${item}")`, { trial: true }), + name: `${item}:hover:trial`, + }) + steps.push({ + fn: () => this.page.hover(`${selector} :text("${item}")`, { force: true }), + name: `${item}:hover:force`, + }) + steps.push({ + fn: () => this.page.click(`${selector} :text("${item}")`, { trial: true }), + name: `${item}:click:trial`, + }) + steps.push({ + fn: () => this.page.click(`${selector} :text("${item}")`, { force: true }), + name: `${item}:click:force`, + }) } for (const step of steps) {