Skip to content

Commit 4490805

Browse files
authored
Fix tablist test perf to fix Nuget pipeline (#3831)
* Make tablist test not async so that it runs faster * Change files
1 parent 32a2af0 commit 4490805

File tree

3 files changed

+31
-33
lines changed

3 files changed

+31
-33
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Make tablist test not async so that it runs faster",
4+
"packageName": "@fluentui-react-native/tablist",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/components/TabList/src/TabList/__tests__/TabList.test.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ describe('TabList component tests', () => {
2121
)
2222
.toJSON();
2323
expect(tree).toMatchSnapshot();
24-
// Each test needs this, again having to do with tests failing during the second render.
25-
await renderer.act(async () => null);
2624
});
2725

28-
it('TabList selected key', async () => {
26+
it('TabList selected key', () => {
2927
const tree = renderer
3028
.create(
3129
<TabList selectedKey="1">
@@ -36,10 +34,9 @@ describe('TabList component tests', () => {
3634
)
3735
.toJSON();
3836
expect(tree).toMatchSnapshot();
39-
await renderer.act(async () => null);
4037
});
4138

42-
it('TabList disabled list', async () => {
39+
it('TabList disabled list', () => {
4340
const tree = renderer
4441
.create(
4542
<TabList disabled>
@@ -50,10 +47,9 @@ describe('TabList component tests', () => {
5047
)
5148
.toJSON();
5249
expect(tree).toMatchSnapshot();
53-
await renderer.act(async () => null);
5450
});
5551

56-
it('TabList appearance', async () => {
52+
it('TabList appearance', () => {
5753
const tree = renderer
5854
.create(
5955
<TabList appearance="subtle">
@@ -64,10 +60,9 @@ describe('TabList component tests', () => {
6460
)
6561
.toJSON();
6662
expect(tree).toMatchSnapshot();
67-
await renderer.act(async () => null);
6863
});
6964

70-
it('TabList size', async () => {
65+
it('TabList size', () => {
7166
const tree = renderer
7267
.create(
7368
<TabList size="large">
@@ -78,10 +73,9 @@ describe('TabList component tests', () => {
7873
)
7974
.toJSON();
8075
expect(tree).toMatchSnapshot();
81-
await renderer.act(async () => null);
8276
});
8377

84-
it('TabList orientation', async () => {
78+
it('TabList orientation', () => {
8579
const tree = renderer
8680
.create(
8781
<TabList vertical>
@@ -92,20 +86,17 @@ describe('TabList component tests', () => {
9286
)
9387
.toJSON();
9488
expect(tree).toMatchSnapshot();
95-
await renderer.act(async () => null);
9689
});
9790

98-
it('TabList re-renders correctly', async () => {
91+
it('TabList re-renders correctly', () => {
9992
checkReRender(
10093
() => (
10194
<TabList>
10295
<Tab tabKey="1">Tab 1</Tab>
10396
<Tab tabKey="2">Tab 2</Tab>
104-
<Tab tabKey="3">Tab 3</Tab>
10597
</TabList>
10698
),
10799
2,
108100
);
109-
await renderer.act(async () => null);
110101
});
111102
});

packages/components/TabList/src/TabList/__tests__/__snapshots__/TabList.test.tsx.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ exports[`TabList component tests TabList appearance 1`] = `
4747
]
4848
}
4949
accessibilityLabel="Tab 1"
50-
accessibilityPositionInSet={0}
50+
accessibilityPositionInSet={1}
5151
accessibilityRole="tab"
52-
accessibilitySetSize={0}
52+
accessibilitySetSize={3}
5353
accessibilityState={
5454
{
5555
"busy": undefined,
@@ -182,9 +182,9 @@ exports[`TabList component tests TabList appearance 1`] = `
182182
]
183183
}
184184
accessibilityLabel="Tab 2"
185-
accessibilityPositionInSet={0}
185+
accessibilityPositionInSet={2}
186186
accessibilityRole="tab"
187-
accessibilitySetSize={0}
187+
accessibilitySetSize={3}
188188
accessibilityState={
189189
{
190190
"busy": undefined,
@@ -317,9 +317,9 @@ exports[`TabList component tests TabList appearance 1`] = `
317317
]
318318
}
319319
accessibilityLabel="Tab 3"
320-
accessibilityPositionInSet={0}
320+
accessibilityPositionInSet={3}
321321
accessibilityRole="tab"
322-
accessibilitySetSize={0}
322+
accessibilitySetSize={3}
323323
accessibilityState={
324324
{
325325
"busy": undefined,
@@ -1391,9 +1391,9 @@ exports[`TabList component tests TabList orientation 1`] = `
13911391
]
13921392
}
13931393
accessibilityLabel="Tab 1"
1394-
accessibilityPositionInSet={0}
1394+
accessibilityPositionInSet={1}
13951395
accessibilityRole="tab"
1396-
accessibilitySetSize={0}
1396+
accessibilitySetSize={3}
13971397
accessibilityState={
13981398
{
13991399
"busy": undefined,
@@ -1525,9 +1525,9 @@ exports[`TabList component tests TabList orientation 1`] = `
15251525
]
15261526
}
15271527
accessibilityLabel="Tab 2"
1528-
accessibilityPositionInSet={0}
1528+
accessibilityPositionInSet={2}
15291529
accessibilityRole="tab"
1530-
accessibilitySetSize={0}
1530+
accessibilitySetSize={3}
15311531
accessibilityState={
15321532
{
15331533
"busy": undefined,
@@ -1659,9 +1659,9 @@ exports[`TabList component tests TabList orientation 1`] = `
16591659
]
16601660
}
16611661
accessibilityLabel="Tab 3"
1662-
accessibilityPositionInSet={0}
1662+
accessibilityPositionInSet={3}
16631663
accessibilityRole="tab"
1664-
accessibilitySetSize={0}
1664+
accessibilitySetSize={3}
16651665
accessibilityState={
16661666
{
16671667
"busy": undefined,
@@ -1837,9 +1837,9 @@ exports[`TabList component tests TabList selected key 1`] = `
18371837
]
18381838
}
18391839
accessibilityLabel="Tab 1"
1840-
accessibilityPositionInSet={0}
1840+
accessibilityPositionInSet={1}
18411841
accessibilityRole="tab"
1842-
accessibilitySetSize={0}
1842+
accessibilitySetSize={3}
18431843
accessibilityState={
18441844
{
18451845
"busy": undefined,
@@ -1972,9 +1972,9 @@ exports[`TabList component tests TabList selected key 1`] = `
19721972
]
19731973
}
19741974
accessibilityLabel="Tab 2"
1975-
accessibilityPositionInSet={0}
1975+
accessibilityPositionInSet={2}
19761976
accessibilityRole="tab"
1977-
accessibilitySetSize={0}
1977+
accessibilitySetSize={3}
19781978
accessibilityState={
19791979
{
19801980
"busy": undefined,
@@ -2107,9 +2107,9 @@ exports[`TabList component tests TabList selected key 1`] = `
21072107
]
21082108
}
21092109
accessibilityLabel="Tab 3"
2110-
accessibilityPositionInSet={0}
2110+
accessibilityPositionInSet={3}
21112111
accessibilityRole="tab"
2112-
accessibilitySetSize={0}
2112+
accessibilitySetSize={3}
21132113
accessibilityState={
21142114
{
21152115
"busy": undefined,

0 commit comments

Comments
 (0)