Unit tests fixed (snapshots updated).

This commit is contained in:
kamre 2022-01-23 12:50:57 +03:00
parent f8995351c9
commit 83fd5899c5
5 changed files with 117 additions and 124 deletions

View file

@ -16,25 +16,36 @@ exports[`components/propertyValueElement Generic fields should allow cancel 1`]
exports[`components/propertyValueElement URL fields should allow cancel 1`] = `
<div>
<div
class="URLProperty property-link url"
class="URLProperty octo-propertyvalue"
>
<input
class="Editable octo-propertyvalue"
placeholder="Empty"
style="width: 5px;"
title="http://localhost"
value="http://localhost"
/>
<a
class="Link__button"
class="link"
href="http://localhost"
rel="noreferrer"
target="_blank"
>
<i
class="CompassIcon icon-link-variant LinkIcon"
/>
http://localhost
</a>
<button
aria-label="Edit"
class="Button IconButton Button_Edit"
title="Edit"
type="button"
>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
</button>
<button
aria-label="Copy"
class="Button IconButton Button_Copy"
title="Copy"
type="button"
>
<i
class="CompassIcon icon-content-copy content-copy"
/>
</button>
</div>
</div>
`;
@ -133,25 +144,36 @@ exports[`components/propertyValueElement should match snapshot, select, read-onl
exports[`components/propertyValueElement should match snapshot, url, array value 1`] = `
<div>
<div
class="URLProperty property-link url"
class="URLProperty octo-propertyvalue"
>
<input
class="Editable octo-propertyvalue"
placeholder="Empty"
style="width: 5px;"
title="http://localhost"
value="http://localhost"
/>
<a
class="Link__button"
class="link"
href="http://localhost"
rel="noreferrer"
target="_blank"
>
<i
class="CompassIcon icon-link-variant LinkIcon"
/>
http://localhost
</a>
<button
aria-label="Edit"
class="Button IconButton Button_Edit"
title="Edit"
type="button"
>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
</button>
<button
aria-label="Copy"
class="Button IconButton Button_Copy"
title="Copy"
type="button"
>
<i
class="CompassIcon icon-content-copy content-copy"
/>
</button>
</div>
</div>
`;
@ -159,25 +181,36 @@ exports[`components/propertyValueElement should match snapshot, url, array value
exports[`components/propertyValueElement should match snapshot, url, array value 2`] = `
<div>
<div
class="URLProperty property-link url"
class="URLProperty octo-propertyvalue"
>
<input
class="Editable octo-propertyvalue"
placeholder="Empty"
style="width: 5px;"
title="http://localhost"
value="http://localhost"
/>
<a
class="Link__button"
class="link"
href="http://localhost"
rel="noreferrer"
target="_blank"
>
<i
class="CompassIcon icon-link-variant LinkIcon"
/>
http://localhost
</a>
<button
aria-label="Edit"
class="Button IconButton Button_Edit"
title="Edit"
type="button"
>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
</button>
<button
aria-label="Copy"
class="Button IconButton Button_Copy"
title="Copy"
type="button"
>
<i
class="CompassIcon icon-content-copy content-copy"
/>
</button>
</div>
</div>
`;

View file

@ -720,12 +720,13 @@ exports[`components/calendar/toolbar return calendar, no date property 1`] = `
>
<a
class="fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-past"
tabindex="0"
>
<div
class="fc-event-main"
>
<div>
<div
class="EventContent"
>
<div
class="octo-icontitle"
>
@ -2979,12 +2980,13 @@ exports[`components/calendar/toolbar return calendar, with date property not set
>
<a
class="fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-past"
tabindex="0"
>
<div
class="fc-event-main"
>
<div>
<div
class="EventContent"
>
<div
class="octo-icontitle"
>
@ -5936,12 +5938,13 @@ exports[`components/calendar/toolbar return calendar, with date property set 1`]
>
<a
class="fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-past"
tabindex="0"
>
<div
class="fc-event-main"
>
<div>
<div
class="EventContent"
>
<div
class="octo-icontitle"
>

View file

@ -3,24 +3,36 @@
exports[`components/properties/link returns link properties correctly 1`] = `
<div>
<div
class="URLProperty property-link url"
class="URLProperty octo-propertyvalue"
>
<input
class="Editable octo-propertyvalue"
style="width: 5px;"
title="https://github.com/mattermost/focalboard"
value="https://github.com/mattermost/focalboard"
/>
<a
class="Link__button"
class="link"
href="https://github.com/mattermost/focalboard"
rel="noreferrer"
target="_blank"
>
<i
class="CompassIcon icon-link-variant LinkIcon"
/>
https://github.com/mattermost/focalboard
</a>
<button
aria-label="Edit"
class="Button IconButton Button_Edit"
title="Edit"
type="button"
>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
</button>
<button
aria-label="Copy"
class="Button IconButton Button_Copy"
title="Copy"
type="button"
>
<i
class="CompassIcon icon-content-copy content-copy"
/>
</button>
</div>
</div>
`;

View file

@ -5,11 +5,13 @@ import React from 'react'
import {render} from '@testing-library/react'
import '@testing-library/jest-dom'
import {wrapIntl} from '../../../testUtils'
import Link from './link'
describe('components/properties/link', () => {
test('returns link properties correctly', () => {
const component = (
const {container} = render(wrapIntl((
<Link
value={'https://github.com/mattermost/focalboard'}
onChange={jest.fn()}
@ -19,8 +21,7 @@ describe('components/properties/link', () => {
return true
})}
/>
)
const {container} = render(component)
)))
expect(container).toMatchSnapshot()
})
})

View file

@ -67,23 +67,9 @@ exports[`components/viewHeader/newCardButtonTemplateItem return NewCardButtonTem
class="MenuOption TextOption menu-option"
role="button"
>
<svg
class="EditIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M35.2,48.7l-2,14.1c-0.1,0.9,0.2,1.9,0.8,2.5c0.6,0.6,1.3,0.9,2.1,0.9c0.1,0,0.3,0,0.4,0l14.1-2c1.7-0.2,3.4-1.1,4.6-2.3 l28.2-28.2l4.6-4.5c1.8-1.8,2.7-4.1,2.7-6.6c0-2.5-1-4.9-2.7-6.6l-4.5-4.5c-3.7-3.7-9.6-3.7-13.3,0l-4.5,4.6L37.5,44.1 C36.2,45.3,35.4,47,35.2,48.7z M74.5,15.6c1.3-1.3,3.5-1.3,4.8,0l4.5,4.5c0.6,0.6,1,1.5,1,2.4c0,0.9-0.4,1.8-1,2.4c0,0,0,0,0,0 l-2.4,2.4L72.1,18L74.5,15.6z M41.1,49.5c0.1-0.4,0.3-0.9,0.6-1.2l26.1-26.1l4.7,4.7l4.7,4.7L51,57.7c-0.3,0.3-0.7,0.5-1.2,0.6 l-10.2,1.4L41.1,49.5z"
/>
<path
d="M88.3,35.8c-1.7,0-3,1.3-3,3v42.7c0,3.6-2.9,6.5-6.5,6.5H21.2c-3.6,0-6.5-2.9-6.5-6.5v-61c0-3.6,2.9-6.5,6.5-6.5h39.2 c1.7,0,3-1.3,3-3s-1.3-3-3-3H21.2C14.3,8,8.7,13.6,8.7,20.5v61c0,6.9,5.6,12.5,12.5,12.5h57.5c6.9,0,12.5-5.6,12.5-12.5V38.8 C91.3,37.2,89.9,35.8,88.3,35.8z"
/>
<path
d="M24.4,72c-1.7,0-3,1.3-3,3s1.3,3,3,3h28.8c1.7,0,3-1.3,3-3s-1.3-3-3-3H24.4z"
/>
</g>
</svg>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
<div
class="menu-name"
>
@ -209,23 +195,9 @@ exports[`components/viewHeader/newCardButtonTemplateItem return NewCardButtonTem
class="MenuOption TextOption menu-option"
role="button"
>
<svg
class="EditIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M35.2,48.7l-2,14.1c-0.1,0.9,0.2,1.9,0.8,2.5c0.6,0.6,1.3,0.9,2.1,0.9c0.1,0,0.3,0,0.4,0l14.1-2c1.7-0.2,3.4-1.1,4.6-2.3 l28.2-28.2l4.6-4.5c1.8-1.8,2.7-4.1,2.7-6.6c0-2.5-1-4.9-2.7-6.6l-4.5-4.5c-3.7-3.7-9.6-3.7-13.3,0l-4.5,4.6L37.5,44.1 C36.2,45.3,35.4,47,35.2,48.7z M74.5,15.6c1.3-1.3,3.5-1.3,4.8,0l4.5,4.5c0.6,0.6,1,1.5,1,2.4c0,0.9-0.4,1.8-1,2.4c0,0,0,0,0,0 l-2.4,2.4L72.1,18L74.5,15.6z M41.1,49.5c0.1-0.4,0.3-0.9,0.6-1.2l26.1-26.1l4.7,4.7l4.7,4.7L51,57.7c-0.3,0.3-0.7,0.5-1.2,0.6 l-10.2,1.4L41.1,49.5z"
/>
<path
d="M88.3,35.8c-1.7,0-3,1.3-3,3v42.7c0,3.6-2.9,6.5-6.5,6.5H21.2c-3.6,0-6.5-2.9-6.5-6.5v-61c0-3.6,2.9-6.5,6.5-6.5h39.2 c1.7,0,3-1.3,3-3s-1.3-3-3-3H21.2C14.3,8,8.7,13.6,8.7,20.5v61c0,6.9,5.6,12.5,12.5,12.5h57.5c6.9,0,12.5-5.6,12.5-12.5V38.8 C91.3,37.2,89.9,35.8,88.3,35.8z"
/>
<path
d="M24.4,72c-1.7,0-3,1.3-3,3s1.3,3,3,3h28.8c1.7,0,3-1.3,3-3s-1.3-3-3-3H24.4z"
/>
</g>
</svg>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
<div
class="menu-name"
>
@ -386,23 +358,9 @@ exports[`components/viewHeader/newCardButtonTemplateItem return NewCardButtonTem
class="MenuOption TextOption menu-option"
role="button"
>
<svg
class="EditIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M35.2,48.7l-2,14.1c-0.1,0.9,0.2,1.9,0.8,2.5c0.6,0.6,1.3,0.9,2.1,0.9c0.1,0,0.3,0,0.4,0l14.1-2c1.7-0.2,3.4-1.1,4.6-2.3 l28.2-28.2l4.6-4.5c1.8-1.8,2.7-4.1,2.7-6.6c0-2.5-1-4.9-2.7-6.6l-4.5-4.5c-3.7-3.7-9.6-3.7-13.3,0l-4.5,4.6L37.5,44.1 C36.2,45.3,35.4,47,35.2,48.7z M74.5,15.6c1.3-1.3,3.5-1.3,4.8,0l4.5,4.5c0.6,0.6,1,1.5,1,2.4c0,0.9-0.4,1.8-1,2.4c0,0,0,0,0,0 l-2.4,2.4L72.1,18L74.5,15.6z M41.1,49.5c0.1-0.4,0.3-0.9,0.6-1.2l26.1-26.1l4.7,4.7l4.7,4.7L51,57.7c-0.3,0.3-0.7,0.5-1.2,0.6 l-10.2,1.4L41.1,49.5z"
/>
<path
d="M88.3,35.8c-1.7,0-3,1.3-3,3v42.7c0,3.6-2.9,6.5-6.5,6.5H21.2c-3.6,0-6.5-2.9-6.5-6.5v-61c0-3.6,2.9-6.5,6.5-6.5h39.2 c1.7,0,3-1.3,3-3s-1.3-3-3-3H21.2C14.3,8,8.7,13.6,8.7,20.5v61c0,6.9,5.6,12.5,12.5,12.5h57.5c6.9,0,12.5-5.6,12.5-12.5V38.8 C91.3,37.2,89.9,35.8,88.3,35.8z"
/>
<path
d="M24.4,72c-1.7,0-3,1.3-3,3s1.3,3,3,3h28.8c1.7,0,3-1.3,3-3s-1.3-3-3-3H24.4z"
/>
</g>
</svg>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
<div
class="menu-name"
>
@ -528,23 +486,9 @@ exports[`components/viewHeader/newCardButtonTemplateItem return NewCardButtonTem
class="MenuOption TextOption menu-option"
role="button"
>
<svg
class="EditIcon Icon"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M35.2,48.7l-2,14.1c-0.1,0.9,0.2,1.9,0.8,2.5c0.6,0.6,1.3,0.9,2.1,0.9c0.1,0,0.3,0,0.4,0l14.1-2c1.7-0.2,3.4-1.1,4.6-2.3 l28.2-28.2l4.6-4.5c1.8-1.8,2.7-4.1,2.7-6.6c0-2.5-1-4.9-2.7-6.6l-4.5-4.5c-3.7-3.7-9.6-3.7-13.3,0l-4.5,4.6L37.5,44.1 C36.2,45.3,35.4,47,35.2,48.7z M74.5,15.6c1.3-1.3,3.5-1.3,4.8,0l4.5,4.5c0.6,0.6,1,1.5,1,2.4c0,0.9-0.4,1.8-1,2.4c0,0,0,0,0,0 l-2.4,2.4L72.1,18L74.5,15.6z M41.1,49.5c0.1-0.4,0.3-0.9,0.6-1.2l26.1-26.1l4.7,4.7l4.7,4.7L51,57.7c-0.3,0.3-0.7,0.5-1.2,0.6 l-10.2,1.4L41.1,49.5z"
/>
<path
d="M88.3,35.8c-1.7,0-3,1.3-3,3v42.7c0,3.6-2.9,6.5-6.5,6.5H21.2c-3.6,0-6.5-2.9-6.5-6.5v-61c0-3.6,2.9-6.5,6.5-6.5h39.2 c1.7,0,3-1.3,3-3s-1.3-3-3-3H21.2C14.3,8,8.7,13.6,8.7,20.5v61c0,6.9,5.6,12.5,12.5,12.5h57.5c6.9,0,12.5-5.6,12.5-12.5V38.8 C91.3,37.2,89.9,35.8,88.3,35.8z"
/>
<path
d="M24.4,72c-1.7,0-3,1.3-3,3s1.3,3,3,3h28.8c1.7,0,3-1.3,3-3s-1.3-3-3-3H24.4z"
/>
</g>
</svg>
<i
class="CompassIcon icon-pencil-outline EditIcon"
/>
<div
class="menu-name"
>