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

View file

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