Skip to content

Commit

Permalink
tests: write test for AFCH.Text.cleanUp()
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Oct 18, 2024
1 parent 2b33a3d commit a20810a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test-submission.js
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' );
} );
} );

0 comments on commit a20810a

Please sign in to comment.