@@ -3,14 +3,6 @@ import { createCookieIfDoesntExist } from "../src/common/util"
3
3
import { hash } from "../src/node/util"
4
4
import { CODE_SERVER_ADDRESS , PASSWORD , STORAGE } from "./constants"
5
5
6
- async function setTimeoutPromise ( milliseconds : number ) : Promise < void > {
7
- return new Promise ( ( resolve , _ ) => {
8
- setTimeout ( ( ) => {
9
- resolve ( )
10
- } , milliseconds )
11
- } )
12
- }
13
-
14
6
describe ( "go home" , ( ) => {
15
7
let browser : Browser
16
8
let page : Page
@@ -71,18 +63,7 @@ describe("go home", () => {
71
63
72
64
// NOTE: this test will fail if you do not run code-server with --home $CODE_SERVER_ADDRESS/healthz
73
65
it ( "should see a 'Go Home' button in the Application Menu that goes to /healthz" , async ( ) => {
74
- let requestedGoHomeUrl = false
75
-
76
66
const GO_HOME_URL = `${ CODE_SERVER_ADDRESS } /healthz`
77
- page . on ( "request" , ( request ) => {
78
- // This ensures that we did make a request to the GO_HOME_URL
79
- // Most reliable way to test button
80
- // because we don't care if the request has a response
81
- // only that it was made
82
- if ( request . url ( ) === GO_HOME_URL ) {
83
- requestedGoHomeUrl = true
84
- }
85
- } )
86
67
// Sometimes a dialog shows up when you navigate
87
68
// asking if you're sure you want to leave
88
69
// so we listen if it comes, we accept it
@@ -101,10 +82,7 @@ describe("go home", () => {
101
82
// Click it and navigate to /healthz
102
83
// NOTE: ran into issues of it failing intermittently
103
84
// without having button: "middle"
104
- await Promise . all ( [
105
- page . waitForNavigation ( ) ,
106
- page . click ( goHomeButton , { button : "middle" } )
107
- ] )
85
+ await Promise . all ( [ page . waitForNavigation ( ) , page . click ( goHomeButton , { button : "middle" } ) ] )
108
86
expect ( page . url ( ) ) . toBe ( GO_HOME_URL )
109
87
} )
110
88
} )
0 commit comments