Skip to content

Commit 2733239

Browse files
authored
<Button /> - testkit - expose isPrefixIconExists and isSuffixIconExists (#6898)
* feat(button.uni.driver): expose affix handlers * feat(button.uni.driver): update types * feat(button.uni.driver): re-add skin to types
1 parent 90f2105 commit 2733239

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/wix-style-react/src/Button/Button.uni.driver.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export interface ButtonUniDriver extends BaseUniDriver {
66
isButtonDisabled: () => Promise<boolean>;
77
isFocused: () => Promise<boolean>;
88
hasSkin: (skinName: ButtonSkin) => Promise<boolean>;
9+
isPrefixIconExists: () => Promise<boolean>;
10+
isSuffixIconExists: () => Promise<boolean>;
911
}
1012

1113
export const buttonDriverFactory: (base: BaseUniDriver) => ButtonUniDriver;

packages/wix-style-react/src/Button/Button.uni.driver.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,18 @@ export const buttonDriverFactory = base => {
3131
* @return {Promise<boolean>}
3232
*/
3333
hasSkin: async skinName => (await base.attr(`data-skin`)) === skinName,
34+
35+
/**
36+
* Checks whether button has an icon prefix
37+
* @return {Promise<boolean>}
38+
*/
39+
isPrefixIconExists: buttonNextDriver.isPrefixIconExists,
40+
41+
/**
42+
* Checks whether button has an icon suffix
43+
* @return {Promise<boolean>}
44+
*/
45+
isSuffixIconExists: buttonNextDriver.isSuffixIconExists,
46+
3447
};
3548
};

0 commit comments

Comments
 (0)