From 1f147a779114a641b4abe5e47ac0b05433ec02fb Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 13 Aug 2023 14:50:26 +0530 Subject: feat: finalizes component system. it fucking works holy shit. --- tests/fixtures/todo-app/index.html | 49 ++++++++++++++++++++++++++++++++++++++ tests/todo-app.spec.ts | 33 +++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 tests/fixtures/todo-app/index.html create mode 100644 tests/todo-app.spec.ts (limited to 'tests') diff --git a/tests/fixtures/todo-app/index.html b/tests/fixtures/todo-app/index.html new file mode 100644 index 0000000..66a9798 --- /dev/null +++ b/tests/fixtures/todo-app/index.html @@ -0,0 +1,49 @@ + + + Task destroyer + + + + + diff --git a/tests/todo-app.spec.ts b/tests/todo-app.spec.ts new file mode 100644 index 0000000..1e0cd72 --- /dev/null +++ b/tests/todo-app.spec.ts @@ -0,0 +1,33 @@ +import { getByTestId, prettyDOM } from '@testing-library/dom' +import '@testing-library/jest-dom' +import { delay, loadHTMLFixture } from './util' + +describe('todo-app example', () => { + describe('Add new task', () => { + beforeAll(async () => { + await loadHTMLFixture('todo-app') + }) + + it('should add new unchecked task', async () => { + const $textInput = getByTestId( + document.body, + 'add-task-input', + ) + $textInput.value = 'Buy Milk' + + const $addBtn = getByTestId( + document.body, + 'add-task-btn', + ) + $addBtn.click() + + await delay(100) + + console.log(prettyDOM(document.body)) + console.log() + console.log() + console.log() + console.log() + }) + }) +}) -- cgit v1.3.1