From a0f758c21347c386226f1cc22cf7489069efb0c8 Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 7 Feb 2018 12:48:40 +0100 Subject: Add more tests --- __tests__/index.js | 84 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 9 deletions(-) (limited to '__tests__/index.js') diff --git a/__tests__/index.js b/__tests__/index.js index df1e62f..59afa38 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -30,25 +30,91 @@ test('simple', t => { - [x] ! False - [ ] ~ None - [x] = True`); - t.is(contents, ''); + t.is(contents, +`
`); }); -test('mchoide', t => { +test('mchoide-snap', t => { const {contents} = render(file(join(__dirname, 'mchoice.md'))); t.snapshot(contents); }); -test('mchoide-raw', t => { +test('all-checked', t => { + const {contents} = render(` + - [x] ! False + - [x] ~ None + - [x] = True`); + t.is(contents, +`
`); +}); + +test('none-checked', t => { + const {contents} = render(` + - [ ] ! False + - [ ] ~ None + - [ ] = True`); + t.is(contents, +`
`); +}); + +test('caps-checked', t => { + const {contents} = render(` + - [X] ! False + - [X] ~ None + - [X] = True`); + t.is(contents, +`
`); +}); + +test('empty-square-check', t => { + const {contents} = render(` + - [] ! False + - [] ~ None + - [] = True`); + t.is(contents, +`
`); +}); + +test('multi-check', t => { + const {contents} = render(` + - [X] = caps + - [] ! empty + - [ ] ! space + - [x] = checkmark`); + t.is(contents, +`
`); +}); + +test('mchoide-raw-snap', t => { const {contents} = renderRaw(file(join(__dirname, 'mchoice-raw.md'))); t.snapshot(contents); }); -test.todo('all checked'); -test.todo('none checked'); -test.todo('caps checked'); -test.todo('enpty square brackets'); -test.todo('every kind of checked'); - test.todo('Citation in a multiple-choice'); test.todo('Feedback feature test'); -- cgit v1.2.3