Fixing tests

This commit is contained in:
Jesús Espino 2021-03-30 20:25:19 +02:00
parent aafc159248
commit 951e85ef32
2 changed files with 23 additions and 24 deletions

View file

@ -10,13 +10,12 @@ exports[`components/content/CheckboxElement should match snapshot 1`] = `
type="checkbox" type="checkbox"
value="off" value="off"
/> />
<div <input
class="octo-editable" class="Editable undefined"
contenteditable="true"
placeholder="Edit text..." placeholder="Edit text..."
> title="test-title"
test-title value="test-title"
</div> />
</div> </div>
</div> </div>
`; `;
@ -31,13 +30,14 @@ exports[`components/content/CheckboxElement should match snapshot on change titl
type="checkbox" type="checkbox"
value="off" value="off"
/> />
<div <input
class="octo-editable" class="Editable undefined"
contenteditable="true"
placeholder="Edit text..." placeholder="Edit text..."
title="test-title"
value="test-title"
> >
changed name changed name
</div> </input>
</div> </div>
</div> </div>
`; `;
@ -53,13 +53,13 @@ exports[`components/content/CheckboxElement should match snapshot on read only 1
type="checkbox" type="checkbox"
value="off" value="off"
/> />
<div <input
class="octo-editable" class="Editable undefined"
contenteditable="false"
placeholder="Edit text..." placeholder="Edit text..."
> readonly=""
test-title title="test-title"
</div> value="test-title"
/>
</div> </div>
</div> </div>
`; `;
@ -74,13 +74,12 @@ exports[`components/content/CheckboxElement should match snapshot on toggle 1`]
type="checkbox" type="checkbox"
value="on" value="on"
/> />
<div <input
class="octo-editable" class="Editable undefined"
contenteditable="true"
placeholder="Edit text..." placeholder="Edit text..."
> title="test-title"
test-title value="test-title"
</div> />
</div> </div>
</div> </div>
`; `;

View file

@ -56,8 +56,8 @@ describe('components/content/CheckboxElement', () => {
readonly={false} readonly={false}
/>, />,
) )
const {container, getByText} = render(component) const {container, getByTitle} = render(component)
const input = getByText(/test-title/i) const input = getByTitle(/test-title/i)
fireEvent.blur(input, {target: {textContent: 'changed name'}}) fireEvent.blur(input, {target: {textContent: 'changed name'}})
expect(container).toMatchSnapshot() expect(container).toMatchSnapshot()
}) })