From 447d9601611ef7488185ea77b3e91456a377be94 Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 7 Feb 2018 03:31:42 +0100 Subject: Make the tests --- __tests__/index.js | 63 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/__tests__/index.js b/__tests__/index.js index b359cd9..ad27736 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -39,17 +39,60 @@ test('line-input-empty', t => { const {contents} = render('[____]'); t.is(contents, '

'); }); +test('line-input-simple-raw', t => { + const {contents} = renderRaw('[__here__]'); + t.is(contents, '

'); +}); + +test('line-input-empty-raw', t => { + const {contents} = renderRaw('[____]'); + t.is(contents, '

'); +}); + +test('line-input-id', t => { + const {contents} = render('[__here__]{#unicorn}'); + t.is(contents, '

'); +}); + +test('line-input-class', t => { + const {contents} = render('[__here__]{.unicorn}'); + t.is(contents, '

'); +}); + +test('line-input-classes', t => { + const {contents} = render('[__here__]{.unicorn .fox}'); + t.is(contents, '

'); +}); + +test('line-input-key-value', t => { + const {contents} = render('[__here__]{unicorn="horse + horn"}'); + t.is(contents, '

'); +}); + +test('line-input-overwrite-type', t => { + const {contents} = render('[__here__]{type=buttom}'); + t.is(contents, '

'); +}); + +test('line-input-overwrite-placeholder', t => { + const {contents} = render('[__here__]{placeholder=\'not here\'}'); + t.is(contents, '

'); +}); + +test('line-input-overwrite-class', t => { + const {contents} = render('[__here__]{class=\'unicorn\' .fox}'); + t.is(contents, '

'); +}); -test.todo('id text'); -test.todo('class'); -test.todo('classes'); -test.todo('key-value'); -test.todo('classes key-value id'); -test.todo('overwrite type'); -test.todo('overwrite placeholder'); -test.todo('overwrite class'); -test.todo('overwrite id'); -test.todo('multiple id'); +test('line-input-overwrite-id', t => { + const {contents} = render('[__here__]{id=unicorn #fox}'); + t.is(contents, '

'); +}); + +test('line-input-multi-id', t => { + const {contents} = render('[__here__]{#unicorn #fox}'); + t.is(contents, '

'); +}); test('line-input-raw', t => { const {contents} = renderRaw(file(join(__dirname, 'input-raw.md'))); -- cgit v1.2.3