diff options
| author | Hank <hank@mullvad.net> | 2022-09-28 13:36:03 +0200 |
|---|---|---|
| committer | Hank <hank@mullvad.net> | 2022-09-30 15:40:18 +0200 |
| commit | 39093fa948692122f339af7037d99a48d63ba82f (patch) | |
| tree | 3254218b11fc441940c24cfe9423565fdf75b01f | |
| parent | 12e28adc9ee88ad911861d91d845e0f711ecae80 (diff) | |
| download | mullvadvpn-39093fa948692122f339af7037d99a48d63ba82f.tar.xz mullvadvpn-39093fa948692122f339af7037d99a48d63ba82f.zip | |
Remove unnecessary await
| -rw-r--r-- | gui/test/e2e/tunnel-state.spec.ts | 8 | ||||
| -rw-r--r-- | gui/test/e2e/utils.ts | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gui/test/e2e/tunnel-state.spec.ts b/gui/test/e2e/tunnel-state.spec.ts index 1931beebb9..985ac9e665 100644 --- a/gui/test/e2e/tunnel-state.spec.ts +++ b/gui/test/e2e/tunnel-state.spec.ts @@ -60,7 +60,7 @@ test('App should show disconnected tunnel state', async () => { const headerColor = await getBackgroundColor(header); expect(headerColor).toBe(UNSECURED_COLOR); - const button = await appWindow.locator('button', { hasText: /secure my connection/i }); + const button = appWindow.locator('button', { hasText: /secure my connection/i }); const buttonColor = await getBackgroundColor(button); expect(buttonColor).toBe(SECURE_COLOR); }); @@ -88,7 +88,7 @@ test('App should show connecting tunnel state', async () => { const headerColor = await getBackgroundColor(header); expect(headerColor).toBe(SECURE_COLOR); - const button = await appWindow.locator('button', { hasText: /cancel/i }); + const button = appWindow.locator('button', { hasText: /cancel/i }); const buttonColor = await getBackgroundColor(button); expect(buttonColor).toBe('rgba(227, 64, 57, 0.6)'); }); @@ -123,7 +123,7 @@ test('App should show connected tunnel state', async () => { const headerColor = await getBackgroundColor(header); expect(headerColor).toBe(SECURE_COLOR); - const button = await appWindow.locator('button', { hasText: /switch location/i }); + const button = appWindow.locator('button', { hasText: /switch location/i }); const buttonColor = await getBackgroundColor(button); expect(buttonColor).toBe('rgba(255, 255, 255, 0.2)'); }); @@ -149,7 +149,7 @@ test('App should show disconnecting tunnel state', async () => { const headerColor = await getBackgroundColor(header); expect(headerColor).toBe(UNSECURED_COLOR); - const button = await appWindow.locator('button', { hasText: /secure my connection/i }); + const button = appWindow.locator('button', { hasText: /secure my connection/i }); const buttonColor = await getBackgroundColor(button); expect(buttonColor).toBe(SECURE_COLOR); }); diff --git a/gui/test/e2e/utils.ts b/gui/test/e2e/utils.ts index c8d75f6119..865d74bb1c 100644 --- a/gui/test/e2e/utils.ts +++ b/gui/test/e2e/utils.ts @@ -62,7 +62,7 @@ export const sendMockIpcResponse = async <T>({ channel, response }: SendMockIpcR ); }; -const getStyleProperty = async (locator: Locator, property: string) => { +const getStyleProperty = (locator: Locator, property: string) => { return locator.evaluate( (el, { property }) => { return window.getComputedStyle(el).getPropertyValue(property); @@ -71,10 +71,10 @@ const getStyleProperty = async (locator: Locator, property: string) => { ); }; -export const getColor = async (locator: Locator) => { +export const getColor = (locator: Locator) => { return getStyleProperty(locator, 'color'); }; -export const getBackgroundColor = async (locator: Locator) => { +export const getBackgroundColor = (locator: Locator) => { return getStyleProperty(locator, 'background-color'); }; |
