@fluentui-react-native/tester 0.101.7 → 0.101.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage';
2
2
  import MenuPageObject, { MenuComponentSelector } from '../pages/MenuPageObject';
3
- import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, Keys, MENUITEM_A11Y_ROLE } from '../../common/consts';
3
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, Keys, MENUITEM_A11Y_ROLE, ExpandCollapseState } from '../../common/consts';
4
4
  import { MENUITEM_TEST_LABEL } from '../../../TestComponents/Menu/consts';
5
5
  import { Platform } from '../../common/BasePage';
6
6
 
@@ -29,6 +29,7 @@ describe('Menu Accessibility Testing', () => {
29
29
  beforeEach(async () => {
30
30
  await MenuPageObject.scrollToTestElement();
31
31
  await MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
32
+ await MenuPageObject.resetTest();
32
33
  });
33
34
 
34
35
  it('Menu - Validate accessibilityRole of menu item is correct', async () => {
@@ -37,19 +38,17 @@ describe('Menu Accessibility Testing', () => {
37
38
  await expect(await MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
38
39
  });
39
40
 
40
- // TestID for Callouts aren't propagating, so this test is failing. Commenting out and creating task to investigate
41
- // it('Menu - Validate accessibilityRole of menu is correct', async () => {
42
- // await expect(await MenuPageObject.didMenuOpen()).toBeTruthy();
43
-
44
- // await expect(await MenuPageObject.getMenuAccessibilityRole()).toEqual(MENU_A11Y_ROLE);
45
- // await expect(await MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
46
- // });
47
-
48
41
  it('Menu - Do not set accessibilityLabel -> Default to MenuItem label', async () => {
49
42
  await MenuPageObject.clickComponent();
50
43
  await expect(await MenuPageObject.getMenuItemAccessibilityLabel(MenuComponentSelector.TertiaryComponent)).toEqual(MENUITEM_TEST_LABEL);
51
44
  await expect(await MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
52
45
  });
46
+
47
+ it('Menu - Click menu -> ExpandCollapseState correctly changes', async () => {
48
+ await MenuPageObject.clickComponent();
49
+ await expect(await MenuPageObject.getMenuExpandCollapseState()).toEqual(ExpandCollapseState.EXPANDED);
50
+ await expect(await MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
51
+ });
53
52
  });
54
53
 
55
54
  describe('Menu Functional Testing', () => {
@@ -57,6 +56,7 @@ describe('Menu Functional Testing', () => {
57
56
  beforeEach(async () => {
58
57
  await MenuPageObject.scrollToTestElement();
59
58
  await MenuPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
59
+ await MenuPageObject.resetTest();
60
60
  });
61
61
 
62
62
  it('Validate OnOpenChange() callback was fired -> Click', async () => {
@@ -73,7 +73,7 @@ describe('Menu Functional Testing', () => {
73
73
 
74
74
  it('Validate OnOpenChange() callback was fired -> Type "SPACE"', async () => {
75
75
  await MenuPageObject.sendKey(MenuComponentSelector.PrimaryComponent, Keys.SPACE);
76
- await expect(await MenuPageObject.didMenuClose()).toBeTruthy();
76
+ await expect(await MenuPageObject.didMenuOpen()).toBeTruthy();
77
77
  await expect(await MenuPageObject.didAssertPopup()).toBeFalsy(MenuPageObject.ERRORMESSAGE_ASSERT);
78
78
  });
79
79
  });
@@ -19,6 +19,7 @@ export const PAGE_TIMEOUT = 15000;
19
19
  export const enum Attribute {
20
20
  AccessibilityLabel = 'Name',
21
21
  AccessibilityRole = 'ControlType',
22
+ ExpandCollapseState = 'ExpandCollapse.ExpandCollapseState',
22
23
  IsEnabled = 'IsEnabled',
23
24
  IsFocused = 'HasKeyboardFocus',
24
25
  IsRequiredForForm = 'IsRequiredForForm',
@@ -96,3 +97,8 @@ export const enum Keys {
96
97
  F11 = '\uE03B',
97
98
  F12 = '\uE03C',
98
99
  }
100
+
101
+ export const enum ExpandCollapseState {
102
+ EXPANDED = 'Expanded',
103
+ COLLAPSED = 'Collapsed',
104
+ }