aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-02-07 03:31:42 +0100
committerache <ache@ache.one>2018-02-07 03:31:42 +0100
commit447d9601611ef7488185ea77b3e91456a377be94 (patch)
treedd56c59481995bcd831f44c01380fb5680c5a677
parentresolve the empty test (diff)
Make the tests
-rw-r--r--__tests__/index.js63
1 files 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, '<p><input type="text"></p>');
});
+test('line-input-simple-raw', t => {
+ const {contents} = renderRaw('[__here__]');
+ t.is(contents, '<p><input type="text" placeholder="here"></p>');
+});
+
+test('line-input-empty-raw', t => {
+ const {contents} = renderRaw('[____]');
+ t.is(contents, '<p><input type="text"></p>');
+});
+
+test('line-input-id', t => {
+ const {contents} = render('[__here__]{#unicorn}');
+ t.is(contents, '<p><input id="unicorn" type="text" placeholder="here"></p>');
+});
+
+test('line-input-class', t => {
+ const {contents} = render('[__here__]{.unicorn}');
+ t.is(contents, '<p><input class="unicorn" type="text" placeholder="here"></p>');
+});
+
+test('line-input-classes', t => {
+ const {contents} = render('[__here__]{.unicorn .fox}');
+ t.is(contents, '<p><input class="unicorn fox" type="text" placeholder="here"></p>');
+});
+
+test('line-input-key-value', t => {
+ const {contents} = render('[__here__]{unicorn="horse + horn"}');
+ t.is(contents, '<p><input unicorn="horse + horn" type="text" placeholder="here"></p>');
+});
+
+test('line-input-overwrite-type', t => {
+ const {contents} = render('[__here__]{type=buttom}');
+ t.is(contents, '<p><input type="text" placeholder="here"></p>');
+});
+
+test('line-input-overwrite-placeholder', t => {
+ const {contents} = render('[__here__]{placeholder=\'not here\'}');
+ t.is(contents, '<p><input type="text" placeholder="here"></p>');
+});
+
+test('line-input-overwrite-class', t => {
+ const {contents} = render('[__here__]{class=\'unicorn\' .fox}');
+ t.is(contents, '<p><input class="fox" type="text" placeholder="here"></p>');
+});
-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, '<p><input id="fox" type="text" placeholder="here"></p>');
+});
+
+test('line-input-multi-id', t => {
+ const {contents} = render('[__here__]{#unicorn #fox}');
+ t.is(contents, '<p><input id="unicorn" type="text" placeholder="here"></p>');
+});
test('line-input-raw', t => {
const {contents} = renderRaw(file(join(__dirname, 'input-raw.md')));