-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
405 additions
and
15 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Copyright (c) 2021-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/teamtile/blob/main/LICENSE | ||
// | ||
|
||
global.ResizeObserver = jest.fn().mockImplementation(() => ({ | ||
observe: jest.fn(), | ||
unobserve: jest.fn(), | ||
disconnect: jest.fn() | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright (c) 2023-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/hitofude/blob/main/LICENSE | ||
// | ||
|
||
import React from 'react'; | ||
|
||
import Communication from './Communication.presenter'; | ||
import IntlProvider from '../../providers/IntlProvider'; | ||
import ThemeProvider from '../../providers/ThemeProvider'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('should create shapshot', async () => { | ||
const params = { | ||
description: 'Something went wrong', | ||
image: 'https://example.com/image.png', | ||
title: '500 Internal Server Error' | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<Communication {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Copyright (c) 2023-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/hitofude/blob/main/LICENSE | ||
// | ||
|
||
import React from 'react'; | ||
|
||
import ErrorNotification from './ErrorNotification.presenter'; | ||
import IntlProvider from '../../providers/IntlProvider'; | ||
import ThemeProvider from '../../providers/ThemeProvider'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('should create shapshot', async () => { | ||
const params = { | ||
message: { | ||
id: 'ErrorMessage', | ||
defaultMessage: 'Something went wrong' | ||
} | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<ErrorNotification {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright (c) 2023-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/hitofude/blob/main/LICENSE | ||
// | ||
|
||
import React from 'react'; | ||
|
||
import ImageViewer from './ImageViewer.presenter'; | ||
import IntlProvider from '../../providers/IntlProvider'; | ||
import ThemeProvider from '../../providers/ThemeProvider'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('should create shapshot', async () => { | ||
const params = { | ||
alt: 'image', | ||
className: 'image', | ||
src: 'https://example.com/image.png' | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<ImageViewer {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// Copyright (c) 2023-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/hitofude/blob/main/LICENSE | ||
// | ||
|
||
import React from 'react'; | ||
|
||
import IntlProvider from '../../providers/IntlProvider'; | ||
import Loader from './Loader.presenter'; | ||
import ThemeProvider from '../../providers/ThemeProvider'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('should create shapshot if loading is "true"', async () => { | ||
const params = { | ||
children: ( | ||
<div data-testid="Children" /> | ||
), | ||
loading: true | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<Loader {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
|
||
it('should create shapshot if loading is "false"', async () => { | ||
const params = { | ||
children: ( | ||
<div data-testid="Children" /> | ||
), | ||
loading: false | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<Loader {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright (c) 2023-2024 karamem0 | ||
// | ||
// This software is released under the MIT License. | ||
// | ||
// https://github.com/karamem0/hitofude/blob/main/LICENSE | ||
// | ||
|
||
import React from 'react'; | ||
|
||
import IntlProvider from '../../providers/IntlProvider'; | ||
import Mermaid from './Mermaid.presenter'; | ||
import ThemeProvider from '../../providers/ThemeProvider'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('should create shapshot', async () => { | ||
const params = { | ||
children: ( | ||
<div data-testid="Children" /> | ||
) | ||
}; | ||
const { asFragment } = render( | ||
<IntlProvider> | ||
<ThemeProvider> | ||
<Mermaid {...params} /> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
73 changes: 73 additions & 0 deletions
73
src/common/components/__snapshots__/Communication.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should create shapshot 1`] = ` | ||
<DocumentFragment> | ||
.emotion-0 { | ||
display: grid; | ||
grid-template-rows: auto auto; | ||
grid-template-columns: auto; | ||
grid-gap: 2rem; | ||
padding: 1rem; | ||
} | ||
.emotion-1 { | ||
max-width: 16rem; | ||
max-height: 12rem; | ||
margin: auto; | ||
} | ||
.emotion-2 { | ||
display: -webkit-box; | ||
display: -webkit-flex; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-flex-direction: column; | ||
-ms-flex-direction: column; | ||
flex-direction: column; | ||
grid-gap: 1rem; | ||
-webkit-align-items: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
-webkit-justify-content: center; | ||
justify-content: center; | ||
color: #707070; | ||
} | ||
.emotion-3 { | ||
font-size: 32px; | ||
line-height: calc(32px * 1.25); | ||
} | ||
<div | ||
class="fui-FluentProvider fui-FluentProviderr0 ___jdtuxv0_17k0bs4 f19n0e5 fxugw4r f1o700av fk6fouc fkhj508 figsok6 f1i3iumi" | ||
dir="ltr" | ||
> | ||
<div | ||
class="emotion-0" | ||
> | ||
<img | ||
alt="500 Internal Server Error" | ||
class="emotion-1" | ||
src="https://example.com/image.png" | ||
/> | ||
<div | ||
class="emotion-2" | ||
> | ||
<h4 | ||
class="fui-Text emotion-3 ___c56hd20_1xy0w11 fk6fouc fkhj508 f1i3iumi figsok6 fpgzoln f1w7gpdv f6juhto f1gl81tg f2jf649" | ||
> | ||
500 Internal Server Error | ||
</h4> | ||
<span | ||
class="fui-Text ___c56hd20_1xy0w11 fk6fouc fkhj508 f1i3iumi figsok6 fpgzoln f1w7gpdv f6juhto f1gl81tg f2jf649" | ||
> | ||
Something went wrong | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |
61 changes: 61 additions & 0 deletions
61
src/common/components/__snapshots__/ErrorNotification.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should create shapshot 1`] = ` | ||
<DocumentFragment> | ||
.emotion-0 { | ||
position: fixed; | ||
z-index: 900; | ||
width: calc(100% - 1rem); | ||
margin: 0.5rem; | ||
background-color: #fafafa; | ||
} | ||
<div | ||
class="fui-FluentProvider fui-FluentProviderr0 ___jdtuxv0_17k0bs4 f19n0e5 fxugw4r f1o700av fk6fouc fkhj508 figsok6 f1i3iumi" | ||
dir="ltr" | ||
> | ||
<div | ||
aria-labelledby="fui-r1" | ||
class="fui-MessageBar r2oyxsj emotion-0 ___hd2t6r0_1l4k1ej f13ftzij frd1ypx f1gyjrma fqyqtrt f18qd5xz" | ||
role="group" | ||
> | ||
<div | ||
class="fui-MessageBar__icon r1df1z33 ___gwngeu0_j951p00 f14a4cve" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
class="___12fm75w_v8ls9a0 f1w7gpdv fez10in fg4l7m0" | ||
fill="currentColor" | ||
height="1em" | ||
viewBox="0 0 20 20" | ||
width="1em" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M8.68 2.79a1.5 1.5 0 0 1 2.64 0l6.5 12A1.5 1.5 0 0 1 16.5 17h-13a1.5 1.5 0 0 1-1.32-2.21l6.5-12ZM10.5 7.5a.5.5 0 0 0-1 0v4a.5.5 0 0 0 1 0v-4Zm.25 6.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</div> | ||
<div | ||
class="fui-MessageBarBody rtatq2b" | ||
> | ||
Something went wrong | ||
</div> | ||
<div | ||
class="fui-MessageBarActions r1t4x98y ___12vb27g_aqou110 fjseox" | ||
/> | ||
<div | ||
class="fui-MessageBarActions__containerAction rgzw8nq" | ||
> | ||
<button | ||
class="fui-Link ___52mpgl0_k1g75g0 f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fkhj508 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f1iuv45f f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1ern45e f1n71otn f1h8hb77 f1deefiw" | ||
type="button" | ||
> | ||
Dismiss | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |
Oops, something went wrong.