forked from wikimedia-gadgets/afc-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: write test for AFCH.Text.cleanUp()
- Loading branch information
1 parent
2b33a3d
commit a20810a
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Tests for src/modules/submission.js | ||
*/ | ||
|
||
/* eslint-env jest */ | ||
|
||
require( './scaffold.js' ); | ||
|
||
resetToAFCApplicablePage(); | ||
|
||
requireScript( 'modules/core.js' ); | ||
requireScript( 'modules/submissions.js' ); | ||
|
||
// It's always good to start simple :) | ||
describe( 'AFCH', () => { | ||
it( 'is an object', () => { | ||
expect( typeof AFCH ).toBe( 'object' ); | ||
} ); | ||
} ); | ||
|
||
describe( 'AFCH.Text.cleanUp', () => { | ||
it( 'simple accept', () => { | ||
const wikicode = 'Test'; | ||
const isAccept = true; | ||
const output = ( new AFCH.Text( wikicode ) ).cleanUp( isAccept ); | ||
expect( output ).toBe( 'Test' ); | ||
} ); | ||
} ); |