Skip to content

Commit 13fddb6

Browse files
committed
Fix all deprecated .is() method warnings
1 parent 78877ea commit 13fddb6

File tree

89 files changed

+128
-128
lines changed

Some content is hidden

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

89 files changed

+128
-128
lines changed

tests/unit/components/Article.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('Article', () => {
114114
});
115115

116116
it('renders a div.article', () => {
117-
expect(wrapper.is('div.article')).toBe(true);
117+
expect(wrapper.element.matches('div.article')).toBe(true);
118118
});
119119

120120
it('provides a page title using the hero section title', () => {

tests/unit/components/Article/Body.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Body', () => {
1919
});
2020

2121
it('renders a div.body wrapper', () => {
22-
expect(wrapper.is('div.body')).toBe(true);
22+
expect(wrapper.element.matches('div.body')).toBe(true);
2323
});
2424

2525
it('renders a `BodyContent`', () => {

tests/unit/components/Article/BodyContent.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('BodyContent', () => {
5959
});
6060

6161
it('renders an article.bodycontent', () => {
62-
expect(wrapper.is('article.body-content')).toBe(true);
62+
expect(wrapper.element.matches('article.body-content')).toBe(true);
6363
});
6464

6565
it('renders a `Columns` layout', () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('ContentNode', () => {
4242
});
4343

4444
it('renders a `BaseContentNode', () => {
45-
expect(wrapper.is(BaseContentNode)).toBe(true);
45+
expect(wrapper.findComponent(BaseContentNode).exists()).toBe(true);
4646
});
4747

4848
// This needs to be directly tested in `articleContent` directly for now due

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Columns', () => {
3535
});
3636

3737
it('renders a .columns.cols-2 row', () => {
38-
expect(wrapper.is('div.columns.cols-2')).toBe(true);
38+
expect(wrapper.element.matches('div.columns.cols-2')).toBe(true);
3939
});
4040

4141
it('renders an `Asset` and `ContentNode` for each col', () => {
@@ -76,7 +76,7 @@ describe('Columns', () => {
7676
});
7777

7878
it('renders a .columns.cols-3 row', () => {
79-
expect(wrapper.is('div.columns.cols-3')).toBe(true);
79+
expect(wrapper.element.matches('div.columns.cols-3')).toBe(true);
8080
});
8181

8282
it('renders an `Asset` and `ContentNode` for each col', () => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ describe('ContentAndMedia', () => {
3333
});
3434

3535
it('renders a div.content-and-media', () => {
36-
expect(wrapper.is('div.content-and-media')).toBe(true);
36+
expect(wrapper.element.matches('div.content-and-media')).toBe(true);
3737
});
3838

3939
it('renders the `mediaPosition` classname', async () => {
40-
expect(wrapper.is('.content-and-media.media-trailing')).toBe(true);
40+
expect(wrapper.element.matches('.content-and-media.media-trailing')).toBe(true);
4141

4242
await wrapper.setProps({ mediaPosition: MediaPosition.leading });
4343
expect(wrapper.classes('media-leading')).toBe(true);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('FullWidth', () => {
3333
});
3434

3535
it('renders a .full-width', () => {
36-
expect(wrapper.is('.full-width')).toBe(true);
36+
expect(wrapper.element.matches('.full-width')).toBe(true);
3737
});
3838

3939
it('renders a `ContentNode`', () => {
@@ -89,12 +89,12 @@ describe('FullWidth', () => {
8989
const groups = wrapper.findAll('.group');
9090
expect(groups.length).toBe(3);
9191

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

97-
expect(groups.at(1).is(LinkableElement)).toBe(true);
97+
expect(groups.at(1).findComponent(LinkableElement).exists()).toBe(true);
9898
expect(groups.at(1).props()).toEqual({
9999
anchor: content[1].anchor,
100100
depth: 0,
@@ -106,7 +106,7 @@ describe('FullWidth', () => {
106106
content[2],
107107
]);
108108

109-
expect(groups.at(2).is(LinkableElement)).toBe(true);
109+
expect(groups.at(2).findComponent(LinkableElement).exists()).toBe(true);
110110
expect(groups.at(2).props()).toEqual({
111111
anchor: content[3].anchor,
112112
depth: 1,

tests/unit/components/Asset.spec.js

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

5555
it('renders a div.asset', () => {
5656
const wrapper = mountAsset('foo.bar');
57-
expect(wrapper.is('div.asset')).toBe(true);
57+
expect(wrapper.element.matches('div.asset')).toBe(true);
5858
expect(wrapper.isEmpty()).toBe(true);
5959
});
6060

tests/unit/components/BreakpointEmitter.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ describe('BreakpointEmitter', () => {
8585

8686
it('renders its default scoped slot', () => {
8787
const wrapper = shallowMount(BreakpointEmitter, { scopedSlots });
88-
expect(wrapper.is('div')).toBe(true);
88+
expect(wrapper.element.tagName.toLowerCase() === 'div').toBe(true);
8989
expect(wrapper.text()).toBe('');
9090
});
9191

9292
it('does not emit anything if it does not match anything', async () => {
9393
window.matchMedia = jest.fn().mockImplementation(matchesNone);
9494
const wrapper = shallowMount(BreakpointEmitter, { scopedSlots });
95-
expect(wrapper.is('div')).toBe(true);
95+
expect(wrapper.element.tagName.toLowerCase() === 'div').toBe(true);
9696
await wrapper.vm.$nextTick();
9797
expect(wrapper.text()).toBe('');
9898
expect(wrapper.emitted('change')).toBeFalsy();

tests/unit/components/CallToAction.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('CallToAction', () => {
4141
});
4242

4343
it('renders a .call-to-action', () => {
44-
expect(wrapper.is('.call-to-action')).toBe(true);
44+
expect(wrapper.element.matches('.call-to-action')).toBe(true);
4545
});
4646

4747
it('renders a row with 2 columns', () => {

0 commit comments

Comments
 (0)