Skip to content

Commit 6479a2b

Browse files
committed
UnblockReview: add tests for hasSignature()
1 parent 18e0bdc commit 6479a2b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

UnblockReview/tests/UnblockReview.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,29 @@ Seem’st thou thrive if he did banish thee, arm against thy quarrel.`;
291291
expect( unblockReview.processAcceptOrDecline( wikitext, paramsAndReason, acceptDeclineReason, DEFAULT_DECLINE_REASON, acceptOrDecline ) ).toBe( expected );
292292
} );
293293
} );
294+
295+
describe( 'hasSignature( text )', () => {
296+
test( 'No signature', () => {
297+
const text = `Testing 123`;
298+
const expected = false;
299+
expect( unblockReview.hasSignature( text ) ).toBe( expected );
300+
} );
301+
302+
test( 'Signature', () => {
303+
const text = `Testing 123. ~~~~`;
304+
const expected = true;
305+
expect( unblockReview.hasSignature( text ) ).toBe( expected );
306+
} );
307+
308+
test( 'Signature inside of <nowiki> tags', () => {
309+
const text = `Testing 123. <nowiki>~~~~</nowiki>`;
310+
const expected = false;
311+
expect( unblockReview.hasSignature( text ) ).toBe( expected );
312+
} );
313+
314+
test( 'Signature inside of <nowiki> tags and outside of nowiki tags', () => {
315+
const text = `Testing 123. <nowiki>~~~~</nowiki> ~~~~`;
316+
const expected = true;
317+
expect( unblockReview.hasSignature( text ) ).toBe( expected );
318+
} );
319+
} );

0 commit comments

Comments
 (0)