Skip to content

Commit

Permalink
chapter-5
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisP707 committed Oct 7, 2022
1 parent e8f7afa commit ac1d7f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Add.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function Add() {}
16 changes: 16 additions & 0 deletions src/__tests__/add.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import '@testing-library/jest-dom';

import Add from '../Add';

describe('todo add', () => {
test('storing input value', async () => {
render(<Add />);

await userEvent.type(screen.getByTestId("todo-input"), "second todo item");

expect(screen.getByDisplayValue(/second todo item/)).toBeInTheDocument();
})
})

0 comments on commit ac1d7f8

Please sign in to comment.