Skip to content

Commit d47be81

Browse files
authored
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. --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> - No changes were made in terms of behavior. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - No changes were made in terms of behavior so it will work as before. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> - 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)
1 parent f5d6275 commit d47be81

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

core/src/components/item/item.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ComponentInterface } from '@stencil/core';
2-
import { Build, Component, Element, Host, Listen, Prop, State, Watch, forceUpdate, h } from '@stencil/core';
2+
import { Component, Element, Host, Listen, Prop, State, Watch, forceUpdate, h } from '@stencil/core';
33
import type { AnchorInterface, ButtonInterface } from '@utils/element-interface';
44
import type { Attributes } from '@utils/helpers';
55
import { inheritAttributes, raf } from '@utils/helpers';
@@ -358,15 +358,6 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac
358358
}
359359

360360
private getFirstInteractive() {
361-
if (Build.isTesting) {
362-
/**
363-
* Pseudo selectors can't be tested in unit tests.
364-
* It will cause an error when running the tests.
365-
*
366-
* TODO: FW-5205 - Remove the build conditional when this is fixed in Stencil
367-
*/
368-
return undefined;
369-
}
370361
const controls = this.el.querySelectorAll<HTMLElement>(
371362
'ion-toggle:not([disabled]), ion-checkbox:not([disabled]), ion-radio:not([disabled]), ion-select:not([disabled])'
372363
);

0 commit comments

Comments
 (0)