Skip to content

Commit 1819b3b

Browse files
committed
Imminent Deprecation
1 parent a0587aa commit 1819b3b

File tree

7 files changed

+24
-22
lines changed

7 files changed

+24
-22
lines changed

test/specs/fedprops/fedprops-item.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ describe( 'Fed props Item', function () {
3939

4040
await ItemPage.open( itemId );
4141

42-
await expect(
43-
$( '.wikibase-statementgroupview-property' )
44-
).toHaveTextContaining( propertyValue ); // value is the label
42+
await expect( $( '.wikibase-statementgroupview-property' ) ).toHaveText(
43+
/propertyValue/
44+
); // value is the label
4545

4646
await SpecialEntityPage.addStatementLink;
4747
} );

test/specs/quickstatements/quickstatements-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe( 'QuickStatements Service', function () {
8888
await browser.pause( 2 * 1000 );
8989

9090
// redirect back to app
91-
await expect( $( 'nav.navbar' ) ).toHaveTextContaining( 'QuickStatements' );
91+
await expect( $( 'nav.navbar' ) ).toHaveText( /QuickStatements/ );
9292
} );
9393

9494
it( 'Should be able to click batch button and be taken to the next page', async function () {

test/specs/repo/extensions/wikibase-local-media.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ describe( 'WikibaseLocalMedia', function () {
3636
await PropertyPage.open( propertyId );
3737

3838
propertyLabel = await $( '#firstHeading' ).getText();
39-
await expect( $( '#firstHeading' ) ).toHaveTextContaining( propertyId );
39+
// eslint-disable-next-line security/detect-non-literal-regexp
40+
await expect( $( '#firstHeading' ) ).toHaveText( new RegExp( propertyId ) );
4041
} );
4142

4243
it( 'Should allow to use uploaded image on statement', async function () {

test/specs/repo/property.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ describe( 'Property', function () {
111111
$( 'ul.mw-contributions-list' ).$$( 'li' )
112112
).resolves.toHaveLength( 4 );
113113
await expect( $( 'span.mw-tag-marker-mw-undo' ) ).toExist();
114-
await expect(
115-
$( 'ul.mw-contributions-list' ).$( 'li.before' )
116-
).toHaveTextContaining( undoSummaryText );
114+
await expect( $( 'ul.mw-contributions-list' ).$( 'li.before' ) ).toHaveText(
115+
new RegExp( undoSummaryText )
116+
);
117117
} );
118118

119119
it( 'Should be able to set label, description, aliases', async function () {

test/specs/repo/special-recent-changes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@ describe( 'Special:RecentChanges', function () {
88
it( 'Should be able to change limit', async function () {
99
await expect(
1010
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
11-
).toHaveTextContaining( '50 changes' );
11+
).toHaveText( /50 changes/ );
1212
await $( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' ).click();
1313
await $( 'div.mw-rcfilters-ui-changesLimitPopupWidget' )
1414
.$( 'span=100' )
1515
.click();
1616
await expect(
1717
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
18-
).toHaveTextContaining( '100 changes' );
18+
).toHaveText( /100 changes/ );
1919
} );
2020

2121
it( 'Should be able to change time to 2 hours', async function () {
2222
await expect(
2323
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
24-
).toHaveTextContaining( '7 days' );
24+
).toHaveText( /7 days/ );
2525
await $( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' ).click();
2626
await $( 'div.mw-rcfilters-ui-datePopupWidget-hours' ).$( 'span=2' ).click();
2727
await expect(
2828
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
29-
).toHaveTextContaining( '2 hours' );
29+
).toHaveText( /2 hours/ );
3030
} );
3131

3232
it( 'Should be able to change time to 3 days', async function () {
3333
await expect(
3434
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
35-
).toHaveTextContaining( '7 days' );
35+
).toHaveText( /7 days/ );
3636
await $( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' ).click();
3737
await $( 'div.mw-rcfilters-ui-datePopupWidget-days' ).$( 'span=3' ).click();
3838
await expect(
3939
$( 'div.mw-rcfilters-ui-changesLimitAndDateButtonWidget' )
40-
).toHaveTextContaining( '3 days' );
40+
).toHaveText( /3 days/ );
4141
} );
4242
} );

test/specs/repo/special-version.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
describe( 'Special:Version', function () {
22
it( 'Should contain the correct MediaWiki version', async function () {
33
await browser.url( `${ testEnv.vars.WIKIBASE_URL }/wiki/Special:Version` );
4-
await expect( $( '#sv-software' ) ).toHaveTextContaining(
5-
`MediaWiki ${ testEnv.vars.MEDIAWIKI_VERSION }`
4+
await expect( $( '#sv-software' ) ).toHaveText(
5+
// eslint-disable-next-line security/detect-non-literal-regexp
6+
new RegExp( `MediaWiki ${ testEnv.vars.MEDIAWIKI_VERSION }` )
67
);
78
} );
89

test/specs/repo_client/item.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ describe( 'Item', function () {
8080
await $( '#wb-setsitelink-submit button' ).click();
8181

8282
// label should come from repo property
83-
await expect(
84-
$( '.wikibase-sitelinklistview-listview li' )
85-
).toHaveTextContaining( 'client_wiki' );
86-
await expect(
87-
$( '.wikibase-sitelinklistview-listview li' )
88-
).toHaveTextContaining( pageTitle );
83+
await expect( $( '.wikibase-sitelinklistview-listview li' ) ).toHaveText(
84+
/client_wiki/
85+
);
86+
await expect( $( '.wikibase-sitelinklistview-listview li' ) ).toHaveText(
87+
new RegExp( pageTitle )
88+
);
8989
} );
9090

9191
it( 'Should be able to see site-link change is dispatched to client', async function () {

0 commit comments

Comments
 (0)