From 175a868a0948eaa98e8854b254887e5704d61376 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Wed, 11 Jan 2023 17:42:48 +1000 Subject: [PATCH] Remove unwarranted check in playwright util --- .../src/editor/switch-block-inspector-tab.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/e2e-test-utils-playwright/src/editor/switch-block-inspector-tab.ts b/packages/e2e-test-utils-playwright/src/editor/switch-block-inspector-tab.ts index 8bb38ddb080b0..1d9b3b0255ad9 100644 --- a/packages/e2e-test-utils-playwright/src/editor/switch-block-inspector-tab.ts +++ b/packages/e2e-test-utils-playwright/src/editor/switch-block-inspector-tab.ts @@ -15,15 +15,12 @@ export async function switchBlockInspectorTab( this: Editor, label: string ) { const inspectorTabButton = this.page.locator( `role=region[name="Editor settings"i] >> role=tab[name="${ label }"i]` ); + const id = await inspectorTabButton.getAttribute( 'id' ); - if ( inspectorTabButton ) { - const id = await inspectorTabButton.getAttribute( 'id' ); - await inspectorTabButton.click(); - - await expect( - this.page.locator( - `role=region[name="Editor settings"i] >> div[role="tabpanel"][aria-labelledby="${ id }"]` - ) - ).toBeVisible(); - } + await inspectorTabButton.click(); + await expect( + this.page.locator( + `role=region[name="Editor settings"i] >> div[role="tabpanel"][aria-labelledby="${ id }"]` + ) + ).toBeVisible(); }