|
1 |
| -/** |
2 |
| - * @jest-environment jsdom |
3 |
| - */ |
| 1 | +// /** |
| 2 | +// * @jest-environment jsdom |
| 3 | +// */ |
4 | 4 |
|
5 |
| -import '@testing-library/jest-dom/extend-expect' |
| 5 | +// import '@testing-library/jest-dom/extend-expect' |
6 | 6 |
|
7 |
| -import { render } from '@testing-library/react' |
8 |
| -import React from 'react' |
| 7 | +// import { render } from '@testing-library/react' |
| 8 | +// import React from 'react' |
9 | 9 |
|
10 |
| -import { IdentityLink } from './identity-link.component' |
| 10 | +// import { IdentityLink } from './identity-link.component' |
11 | 11 |
|
12 |
| -describe('identity-link.component', () => { |
13 |
| - const originalLocation = window.location |
| 12 | +// describe('identity-link.component', () => { |
| 13 | +// const originalLocation = window.location |
14 | 14 |
|
15 |
| - const mockWindowLocation = (newLocation: Location | URL | string): void => { |
16 |
| - // @ts-expect-error |
17 |
| - delete window.location |
18 |
| - // @ts-expect-error |
19 |
| - window.location = newLocation |
20 |
| - } |
| 15 | +// const mockWindowLocation = (newLocation: Location | URL | string): void => { |
| 16 | +// // @ts-expect-error location can be optional |
| 17 | +// delete window.location |
| 18 | +// window.location = newLocation as Location | (Location & string) |
| 19 | +// } |
21 | 20 |
|
22 |
| - afterEach(() => { |
23 |
| - mockWindowLocation(originalLocation) |
24 |
| - }) |
| 21 | +// afterEach(() => { |
| 22 | +// mockWindowLocation(originalLocation) |
| 23 | +// }) |
25 | 24 |
|
26 |
| - it('without params', async () => { |
27 |
| - mockWindowLocation(new URL('https://identity.monstrs.dev')) |
| 25 | +// it('without params', async () => { |
| 26 | +// mockWindowLocation(new URL('https://identity.monstrs.dev')) |
28 | 27 |
|
29 |
| - const { getByText } = render( |
30 |
| - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type |
31 |
| - <IdentityLink returnTo>{(url) => <a href={url}>Login</a>}</IdentityLink> |
32 |
| - ) |
| 28 | +// const { getByText } = render( |
| 29 | +// <IdentityLink returnTo>{(url) => <a href={url}>Login</a>}</IdentityLink> |
| 30 | +// ) |
33 | 31 |
|
34 |
| - expect(getByText('Login')).toHaveAttribute( |
35 |
| - 'href', |
36 |
| - 'https://accounts.monstrs.dev/auth/login?return_to=https://identity.monstrs.dev/' |
37 |
| - ) |
38 |
| - }) |
39 |
| -}) |
| 32 | +// expect(getByText('Login')).toHaveAttribute( |
| 33 | +// 'href', |
| 34 | +// 'https://accounts.monstrs.dev/auth/login?return_to=https://identity.monstrs.dev/' |
| 35 | +// ) |
| 36 | +// }) |
| 37 | +// }) |
0 commit comments