Skip to content

Commit 182bb33

Browse files
committed
Fix .find() and .get() deprecation warnings
1 parent 7126f9a commit 182bb33

34 files changed

+140
-140
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('FullWidth', () => {
4040
const groups = wrapper.findAll('.group');
4141
expect(groups.length).toBe(1);
4242

43-
const node = groups.at(0).find(ContentNode);
43+
const node = groups.at(0).findComponent(ContentNode);
4444
expect(node.exists()).toBe(true);
4545
expect(node.props('content')).toEqual(propsData.content);
4646
});
@@ -90,7 +90,7 @@ describe('FullWidth', () => {
9090
expect(groups.length).toBe(3);
9191

9292
expect(groups.at(0).element.tagName.toLowerCase() === 'div').toBe(true);
93-
expect(groups.at(0).find(ContentNode).props('content')).toEqual([
93+
expect(groups.at(0).findComponent(ContentNode).props('content')).toEqual([
9494
content[0],
9595
]);
9696

@@ -101,7 +101,7 @@ describe('FullWidth', () => {
101101
tag: 'div',
102102
title: content[1].text,
103103
});
104-
expect(groups.at(1).find(ContentNode).props('content')).toEqual([
104+
expect(groups.at(1).findComponent(ContentNode).props('content')).toEqual([
105105
content[1],
106106
content[2],
107107
]);
@@ -113,7 +113,7 @@ describe('FullWidth', () => {
113113
tag: 'div',
114114
title: content[3].text,
115115
});
116-
expect(groups.at(2).find(ContentNode).props('content')).toEqual([
116+
expect(groups.at(2).findComponent(ContentNode).props('content')).toEqual([
117117
content[3],
118118
content[4],
119119
content[5],

tests/unit/components/Asset.spec.js

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

107107
it('renders a `ReplayableVideoAsset` without poster variants', () => {
108108
const identifier = 'video';
109-
const videoAsset = mountAsset(identifier, { video }).find(ReplayableVideoAsset);
109+
const videoAsset = mountAsset(identifier, { video }).findComponent(ReplayableVideoAsset);
110110
expect(videoAsset.props('variants')).toBe(video.variants);
111111
expect(videoAsset.props('posterVariants')).toEqual([]);
112112
expect(videoAsset.props('id')).toBe(identifier);

tests/unit/components/CallToAction.spec.js

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

7474
it('renders abstract', () => {
75-
const node = col.find(ContentNode);
75+
const node = col.findComponent(ContentNode);
7676
expect(node.exists()).toBe(true);
7777
expect(node.props('content')).toEqual([{
7878
type: 'paragraph',
@@ -81,14 +81,14 @@ describe('CallToAction', () => {
8181
});
8282

8383
it('renders a button', () => {
84-
const btn = col.find(Button);
84+
const btn = col.findComponent(Button);
8585
expect(btn.exists()).toBe(true);
8686
expect(btn.props('action')).toEqual(propsData.action);
8787
});
8888
});
8989

9090
it('renders an asset in the RightColumn', () => {
91-
const asset = wrapper.findComponent(RightColumn).find(Asset);
91+
const asset = wrapper.findComponent(RightColumn).findComponent(Asset);
9292
expect(asset.exists()).toBe(true);
9393
expect(asset.props('identifier')).toBe(propsData.media);
9494
});

tests/unit/components/Card.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe('Card', () => {
191191
});
192192

193193
it('renders a Reference component at the root', () => {
194-
expect(mountCard().find(Reference).props('url')).toBe(propsData.url);
194+
expect(mountCard().findComponent(Reference).props('url')).toBe(propsData.url);
195195
});
196196

197197
it('renders a .large or .small modifier depending on the size', () => {

0 commit comments

Comments
 (0)