From d47be8165a12beb4f4fb4532952328aae0b72208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20M?= Date: Wed, 14 Feb 2024 01:46:16 +0000 Subject: [PATCH] refactor(item): remove build conditional for test environment (#29007) - Fix Internal issue (FW-5205) - Removed the build conditional in the `item` component since the previous issue is already fixed in Stencil. --------- ## What is the current behavior? - No changes were made in terms of behavior. ## What is the new behavior? - No changes were made in terms of behavior so it will work as before. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information - Spec tests still pass even after this change (we can see below the results before and after the change) - Ran the command `npm run test.spec src/components/item/test/item.spec.ts src/components/item/test/item.spec.tsx` ![image](https://github.com/ionic-team/ionic-framework/assets/29493222/54a5f41c-d2c1-46e5-a220-2b881d5bd318) --- core/src/components/item/item.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index c6c18d4e98..daec41d83d 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -1,5 +1,5 @@ import type { ComponentInterface } from '@stencil/core'; -import { Build, Component, Element, Host, Listen, Prop, State, Watch, forceUpdate, h } from '@stencil/core'; +import { Component, Element, Host, Listen, Prop, State, Watch, forceUpdate, h } from '@stencil/core'; import type { AnchorInterface, ButtonInterface } from '@utils/element-interface'; import type { Attributes } from '@utils/helpers'; import { inheritAttributes, raf } from '@utils/helpers'; @@ -358,15 +358,6 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac } private getFirstInteractive() { - if (Build.isTesting) { - /** - * Pseudo selectors can't be tested in unit tests. - * It will cause an error when running the tests. - * - * TODO: FW-5205 - Remove the build conditional when this is fixed in Stencil - */ - return undefined; - } const controls = this.el.querySelectorAll( 'ion-toggle:not([disabled]), ion-checkbox:not([disabled]), ion-radio:not([disabled]), ion-select:not([disabled])' );