Skip to content

Commit 71f3b70

Browse files
committed
Fix .findAll() deprecation warnings
1 parent 182bb33 commit 71f3b70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+240
-237
lines changed

tests/unit/components/Article/Layouts/Columns.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ describe('Columns', () => {
3939
});
4040

4141
it('renders an `Asset` and `ContentNode` for each col', () => {
42-
const nodes = wrapper.findAll(ContentNode);
42+
const nodes = wrapper.findAllComponents(ContentNode);
4343
expect(nodes.length).toBe(2);
4444
expect(nodes.at(0).props('content'))
4545
.toEqual(propsData.columns[0].content);
4646
expect(nodes.at(1).props('content'))
4747
.toEqual(propsData.columns[1].content);
4848

49-
const assets = wrapper.findAll(Asset);
49+
const assets = wrapper.findAllComponents(Asset);
5050
expect(assets.length).toBe(2);
5151
expect(assets.at(0).props('identifier'))
5252
.toBe(propsData.columns[0].media);
@@ -56,7 +56,7 @@ describe('Columns', () => {
5656

5757
it('does not allow autoplay for video assets', () => {
5858
const allowsAutoplay = asset => asset.props('videoAutoplays');
59-
const assets = wrapper.findAll(Asset);
59+
const assets = wrapper.findAllComponents(Asset);
6060
expect(assets.length).toEqual(2);
6161
expect(assets.filter(allowsAutoplay).length).toEqual(0);
6262
});
@@ -80,7 +80,7 @@ describe('Columns', () => {
8080
});
8181

8282
it('renders an `Asset` and `ContentNode` for each col', () => {
83-
const nodes = wrapper.findAll(ContentNode);
83+
const nodes = wrapper.findAllComponents(ContentNode);
8484
expect(nodes.length).toBe(3);
8585
expect(nodes.at(0).props('content'))
8686
.toEqual(propsData.columns[0].content);
@@ -89,7 +89,7 @@ describe('Columns', () => {
8989
expect(nodes.at(2).props('content'))
9090
.toEqual(propsData.columns[2].content);
9191

92-
const assets = wrapper.findAll(Asset);
92+
const assets = wrapper.findAllComponents(Asset);
9393
expect(assets.length).toBe(3);
9494
expect(assets.at(0).props('identifier'))
9595
.toBe(propsData.columns[0].media);
@@ -114,7 +114,7 @@ describe('Columns', () => {
114114
});
115115

116116
it('does not render a `ContentNode` for that column', () => {
117-
const nodes = wrapper.findAll(ContentNode);
117+
const nodes = wrapper.findAllComponents(ContentNode);
118118
expect(nodes.length).toBe(2);
119119

120120
expect(nodes.at(0).props('content')).toEqual(propsData.columns[0].content);

tests/unit/components/ContentNode.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ describe('ContentNode', () => {
483483
expect(grid.props()).toEqual({
484484
columns: { large: 4 },
485485
});
486-
const columns = grid.findAll(Column);
486+
const columns = grid.findAllComponents(Column);
487487
expect(columns).toHaveLength(2);
488488
expect(columns.at(0).props()).toEqual({ span: 2 });
489489
expect(columns.at(0).find('p').text()).toBe('foo');
@@ -527,7 +527,7 @@ describe('ContentNode', () => {
527527
expect(grid.props()).toEqual({
528528
columns: undefined,
529529
});
530-
const columns = grid.findAll(Column);
530+
const columns = grid.findAllComponents(Column);
531531
expect(columns).toHaveLength(2);
532532
expect(columns.at(0).props()).toEqual({ span: 2 });
533533
expect(columns.at(0).find('p').text()).toBe('foo');

tests/unit/components/ContentNode/EndpointExample.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('EndpointExample', () => {
6060

6161
it('renders tabs for request/response links', () => {
6262
const tabnav = wrapper.findComponent(Tabnav);
63-
const tabnavLinks = wrapper.findAll(TabnavItem);
63+
const tabnavLinks = wrapper.findAllComponents(TabnavItem);
6464
expect(tabnav.props()).toHaveProperty('value', Tab.request);
6565
expect(tabnavLinks.length).toBe(2);
6666
expect(tabnavLinks.at(0).props('value')).toBe(Tab.request);

tests/unit/components/ContentNode/TabNavigator.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('TabNavigator.spec', () => {
5252
vertical: false,
5353
value: titles[0],
5454
});
55-
expect(wrapper.findAll(TabnavItem)).toHaveLength(3);
55+
expect(wrapper.findAllComponents(TabnavItem)).toHaveLength(3);
5656
const tabs = wrapper.findAll('.tab-container');
5757
expect(tabs).toHaveLength(3);
5858
expect(tabs.at(0).classes()).toContain('active');

tests/unit/components/DocumentationTopic/DecoratedTopicTitle.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('DecoratedTopicTitle', () => {
5555
});
5656

5757
it('renders a <WordBreak> for each token that isn\'t all whitespace', () => {
58-
const breaks = wrapper.findAll(WordBreak);
58+
const breaks = wrapper.findAllComponents(WordBreak);
5959
expect(breaks.length).toBe(4);
6060
expect(breaks.at(0).text()).toBe(propsData.tokens[0].text);
6161
expect(breaks.at(0).classes()).toEqual(['decorator']);

tests/unit/components/DocumentationTopic/Hero/DocumentationHero.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('DocumentationHero', () => {
5353

5454
it('renders the DocumentationHero, enabled', () => {
5555
const wrapper = createWrapper();
56-
const allIcons = wrapper.findAll(TopicTypeIcon);
56+
const allIcons = wrapper.findAllComponents(TopicTypeIcon);
5757
expect(allIcons).toHaveLength(1);
5858
expect(allIcons.at(0).props()).toEqual({
5959
withColors: true,
@@ -144,7 +144,7 @@ describe('DocumentationHero', () => {
144144
enhanceBackground: false,
145145
});
146146
// assert no icon
147-
const allIcons = wrapper.findAll(TopicTypeIcon);
147+
const allIcons = wrapper.findAllComponents(TopicTypeIcon);
148148
expect(allIcons).toHaveLength(0);
149149
// assert slot
150150
expect(wrapper.findComponent('.default-slot').text()).toBe('Default Slot');

tests/unit/components/DocumentationTopic/Hero/Hierarchy.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('Hierarchy', () => {
9999
const list = wrapper.findComponent(NavMenuItems);
100100
expect(list.exists()).toBe(true);
101101

102-
const items = list.findAll(HierarchyItem);
102+
const items = list.findAllComponents(HierarchyItem);
103103
expect(items.length).toBe(3);
104104

105105
const fooItem = items.at(0);
@@ -152,7 +152,7 @@ describe('Hierarchy', () => {
152152
const list = wrapper.findComponent(NavMenuItems);
153153
expect(list.exists()).toBe(true);
154154

155-
const items = list.findAll(HierarchyItem);
155+
const items = list.findAllComponents(HierarchyItem);
156156
// all parentTopicIdentifiers + the last item
157157
expect(items.length).toBe(parentTopics.length + 1);
158158

@@ -194,7 +194,7 @@ describe('Hierarchy', () => {
194194
it('renders a list with `root + 2 collapsed + max 2 items`, between 1000 and 1200px', async () => {
195195
changeSize(1100);
196196
await wrapper.vm.$nextTick();
197-
const items = wrapper.findAll(HierarchyItem);
197+
const items = wrapper.findAllComponents(HierarchyItem);
198198
// assert what items are shown
199199
// assert root item
200200
expect(items.at(0).attributes('url')).toEqual(parentTopics[0].url);
@@ -237,7 +237,7 @@ describe('Hierarchy', () => {
237237
it('renders a list with `3 collapsed + max 1 item`, between 735 and 1000px', async () => {
238238
changeSize(900);
239239
await wrapper.vm.$nextTick();
240-
const items = wrapper.findAll(HierarchyItem);
240+
const items = wrapper.findAllComponents(HierarchyItem);
241241
// assert what items are shown
242242
// assert there is no root item
243243
expect(items.at(0).attributes()).toEqual({
@@ -287,7 +287,7 @@ describe('Hierarchy', () => {
287287
it('renders a list with `5 collapsed and no external links`, below 735', async () => {
288288
changeSize(720);
289289
await wrapper.vm.$nextTick();
290-
const items = wrapper.findAll(HierarchyItem);
290+
const items = wrapper.findAllComponents(HierarchyItem);
291291
// assert what items are shown
292292
// assert there is no root item
293293
expect(items.at(0).attributes()).toEqual({
@@ -354,7 +354,7 @@ describe('Hierarchy', () => {
354354
const list = wrapper.findComponent(NavMenuItems);
355355
expect(list.exists()).toBe(true);
356356

357-
const items = list.findAll(HierarchyItem);
357+
const items = list.findAllComponents(HierarchyItem);
358358
// all parentTopicIdentifiers + the last item
359359
expect(items.length).toBe(parentTopics.length + 1);
360360

@@ -404,7 +404,7 @@ describe('Hierarchy', () => {
404404
isSymbolBeta: true,
405405
});
406406

407-
const items = wrapper.findAll(HierarchyItem);
407+
const items = wrapper.findAllComponents(HierarchyItem);
408408
// assert what items are shown
409409
// assert root item
410410
expect(items.at(0).attributes('url')).toEqual(parentTopics[0].url);
@@ -455,7 +455,7 @@ describe('Hierarchy', () => {
455455
isSymbolBeta: true,
456456
});
457457

458-
const items = wrapper.findAll(HierarchyItem);
458+
const items = wrapper.findAllComponents(HierarchyItem);
459459
// assert what items are shown
460460
// assert there is no root item
461461
expect(items.at(0).attributes()).toEqual({
@@ -511,7 +511,7 @@ describe('Hierarchy', () => {
511511
isSymbolBeta: true,
512512
});
513513

514-
const items = wrapper.findAll(HierarchyItem);
514+
const items = wrapper.findAllComponents(HierarchyItem);
515515
// assert what items are shown
516516
// assert there is no root item
517517
expect(items.at(0).attributes()).toEqual({
@@ -608,9 +608,9 @@ describe('Hierarchy', () => {
608608
},
609609
});
610610

611-
const HierarchyItems = wrapper.findAll(HierarchyItem);
611+
const HierarchyItems = wrapper.findAllComponents(HierarchyItem);
612612
// The badges are rendered inside the last HierarchyItem slot
613-
const badges = HierarchyItems.at(HierarchyItems.length - 1).findAll(Badge);
613+
const badges = HierarchyItems.at(HierarchyItems.length - 1).findAllComponents(Badge);
614614
expect(badges).toHaveLength(3);
615615
expect(badges.at(0).props('variant')).toBe('deprecated');
616616
expect(badges.at(0).text()).toBe('aside-kind.deprecated');

tests/unit/components/DocumentationTopic/PrimaryContent.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('PrimaryContent', () => {
181181
function checkProps(Component, props, { info = '', at = 0 } = {}) {
182182
it(`renders a "${Component.name}"${info ? `: ${info}` : ''}`, () => {
183183
const wrapper = shallowMount(PrimaryContent, { propsData });
184-
const component = wrapper.findAll(Component).at(at);
184+
const component = wrapper.findAllComponents(Component).at(at);
185185
expect(component.exists()).toBe(true);
186186
expect(component.props()).toEqual(props);
187187
});

tests/unit/components/DocumentationTopic/PrimaryContent/Declaration.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Declaration', () => {
7373
});
7474

7575
it('renders 1 `DeclarationList` and 0 labels without multiple declarations', () => {
76-
const declarationLists = wrapper.findAll(DeclarationList);
76+
const declarationLists = wrapper.findAllComponents(DeclarationList);
7777
expect(declarationLists).toHaveLength(1);
7878
expect(declarationLists.at(0).props('shouldCaption')).toEqual(false);
7979
});
@@ -155,7 +155,7 @@ describe('Declaration', () => {
155155

156156
await wrapper.setProps({ declarations });
157157

158-
const labels = wrapper.findAll(DeclarationList);
158+
const labels = wrapper.findAllComponents(DeclarationList);
159159
expect(labels.length).toBe(declarations.length);
160160
expect(labels.at(0).props('shouldCaption')).toBe(true);
161161
expect(labels.at(1).props('shouldCaption')).toBe(true);
@@ -180,7 +180,7 @@ describe('Declaration', () => {
180180

181181
await wrapper.setProps({ declarations });
182182

183-
const labels = wrapper.findAll(DeclarationList);
183+
const labels = wrapper.findAllComponents(DeclarationList);
184184
expect(labels.length).toBe(declarations.length);
185185
expect(labels.at(0).props('shouldCaption')).toBe(false);
186186
expect(labels.at(1).props('shouldCaption')).toBe(false);

tests/unit/components/DocumentationTopic/PrimaryContent/DeclarationDiff.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('DeclarationDiff', () => {
3333
expect(labels.at(0).text()).toEqual('Current');
3434
expect(labels.at(1).text()).toEqual('Previous');
3535

36-
const currentLists = wrapper.findComponent('.declaration-diff-current').findAll(DeclarationList);
36+
const currentLists = wrapper.findComponent('.declaration-diff-current').findAllComponents(DeclarationList);
3737

3838
expect(currentLists).toHaveLength(2);
3939
expect(currentLists.at(0).props()).toEqual({
@@ -47,7 +47,7 @@ describe('DeclarationDiff', () => {
4747
declListExpanded: false,
4848
});
4949

50-
const previousLists = wrapper.findComponent('.declaration-diff-previous').findAll(DeclarationList);
50+
const previousLists = wrapper.findComponent('.declaration-diff-previous').findAllComponents(DeclarationList);
5151

5252
expect(previousLists).toHaveLength(1);
5353
expect(previousLists.at(0).props()).toEqual({

0 commit comments

Comments
 (0)