Skip to content

Commit c886761

Browse files
committed
Move app tests under test/app
1 parent fa4692d commit c886761

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+177
-177
lines changed

test/api/ShlinkApiProxyClient.client.test.ts renamed to test/app/api/ShlinkApiProxyClient.client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
ShlinkShortUrlIdentifier,
88
} from '@shlinkio/shlink-js-sdk/api-contract';
99
import { fromPartial } from '@total-typescript/shoehorn';
10-
import { ShlinkApiProxyClient } from '../../app/api/ShlinkApiProxyClient.client';
10+
import { ShlinkApiProxyClient } from '../../../app/api/ShlinkApiProxyClient.client';
1111

1212
describe('ShlinkApiProxyClient', () => {
1313
let proxyClient: ShlinkApiProxyClient;

test/auth/auth-helper.server.test.ts renamed to test/app/auth/auth-helper.server.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { fromPartial } from '@total-typescript/shoehorn';
22
import type { SessionStorage } from 'react-router';
33
import type { Authenticator } from 'remix-auth';
4-
import { AuthHelper } from '../../app/auth/auth-helper.server';
5-
import type { SessionData, ShlinkSessionData } from '../../app/auth/session-context';
4+
import { AuthHelper } from '../../../app/auth/auth-helper.server';
5+
import type { SessionData, ShlinkSessionData } from '../../../app/auth/session-context';
66

77
describe('AuthHelper', () => {
88
const authenticate = vi.fn();

test/auth/auth.server.test.ts renamed to test/app/auth/auth.server.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fromPartial } from '@total-typescript/shoehorn';
22
import { Authenticator } from 'remix-auth';
3-
import { createAuthenticator, CREDENTIALS_STRATEGY } from '../../app/auth/auth.server';
4-
import type { UsersService } from '../../app/users/UsersService.server';
3+
import { createAuthenticator, CREDENTIALS_STRATEGY } from '../../../app/auth/auth.server';
4+
import type { UsersService } from '../../../app/users/UsersService.server';
55

66
describe('auth', () => {
77
const getUserByCredentials = vi.fn();

test/auth/passwords.server.test.ts renamed to test/app/auth/passwords.server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { generatePassword, hashPassword, verifyPassword } from '../../app/auth/passwords.server';
1+
import { generatePassword, hashPassword, verifyPassword } from '../../../app/auth/passwords.server';
22

33
describe('passwords', () => {
44
it('can hash and then verify a password', async () => {

test/auth/session.server.test.ts renamed to test/app/auth/session.server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSessionStorage } from '../../app/auth/session.server';
1+
import { createSessionStorage } from '../../../app/auth/session.server';
22

33
describe('createSessionStorage', () => {
44
it('creates a session storage', () => {

test/common/CopyToClipbord.test.tsx renamed to test/app/common/CopyToClipbord.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render } from '@testing-library/react';
22
import type { ReactNode } from 'react';
3-
import { CopyToClipboard } from '../../app/common/CopyToClipboard';
4-
import { checkAccessibility } from '../__helpers__/accessibility';
3+
import { CopyToClipboard } from '../../../app/common/CopyToClipboard';
4+
import { checkAccessibility } from '../../__helpers__/accessibility';
55

66
describe('<CopyToClipboard />', () => {
77
const setUp = (children?: ReactNode) => render(<CopyToClipboard text="The text">{children}</CopyToClipboard>);

test/common/MainHeader.test.tsx renamed to test/app/common/MainHeader.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { screen } from '@testing-library/react';
22
import { fromPartial } from '@total-typescript/shoehorn';
33
import { MemoryRouter } from 'react-router';
4-
import type { SessionData } from '../../app/auth/session-context';
5-
import { SessionProvider } from '../../app/auth/session-context';
6-
import { MainHeader } from '../../app/common/MainHeader';
7-
import { checkAccessibility } from '../__helpers__/accessibility';
8-
import { renderWithEvents } from '../__helpers__/set-up-test';
4+
import type { SessionData } from '../../../app/auth/session-context';
5+
import { SessionProvider } from '../../../app/auth/session-context';
6+
import { MainHeader } from '../../../app/common/MainHeader';
7+
import { checkAccessibility } from '../../__helpers__/accessibility';
8+
import { renderWithEvents } from '../../__helpers__/set-up-test';
99

1010
describe('<MainHeader />', () => {
1111
const setUp = (session: SessionData | null = null) => renderWithEvents(

test/middleware/middleware.server.test.ts renamed to test/app/middleware/middleware.server.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { fromPartial } from '@total-typescript/shoehorn';
22
import type { unstable_RouterContextProvider } from 'react-router';
3-
import type { AuthHelper } from '../../app/auth/auth-helper.server';
4-
import type { SessionData } from '../../app/auth/session-context';
5-
import type { Role } from '../../app/entities/User';
3+
import type { AuthHelper } from '../../../app/auth/auth-helper.server';
4+
import type { SessionData } from '../../../app/auth/session-context';
5+
import type { Role } from '../../../app/entities/User';
66
import {
77
authMiddleware,
88
ensureAdminMiddleware,
99
ensureNotManagedMiddleware,
10-
} from '../../app/middleware/middleware.server';
10+
} from '../../../app/middleware/middleware.server';
1111

1212
describe('middleware', () => {
1313
const next = vi.fn().mockResolvedValue(new Response('Success', { status: 200 }));

test/routes/change-password.test.tsx renamed to test/app/routes/change-password.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { screen } from '@testing-library/react';
22
import { fromPartial } from '@total-typescript/shoehorn';
33
import { createRoutesStub } from 'react-router';
4-
import type { AuthHelper } from '../../app/auth/auth-helper.server';
5-
import ChangePassword, { action, loader } from '../../app/routes/change-password';
6-
import { INVALID_PASSWORD_FORMAT } from '../../app/routes/profile/change-password-action.server';
7-
import { PasswordMismatchError } from '../../app/users/PasswordMismatchError.server';
8-
import type { UsersService } from '../../app/users/UsersService.server';
9-
import { ValidationError } from '../../app/validation/ValidationError.server';
10-
import { renderWithEvents } from '../__helpers__/set-up-test';
4+
import type { AuthHelper } from '../../../app/auth/auth-helper.server';
5+
import ChangePassword, { action, loader } from '../../../app/routes/change-password';
6+
import { INVALID_PASSWORD_FORMAT } from '../../../app/routes/profile/change-password-action.server';
7+
import { PasswordMismatchError } from '../../../app/users/PasswordMismatchError.server';
8+
import type { UsersService } from '../../../app/users/UsersService.server';
9+
import { ValidationError } from '../../../app/validation/ValidationError.server';
10+
import { renderWithEvents } from '../../__helpers__/set-up-test';
1111

1212
describe('change-password', () => {
1313
describe('loader', () => {

test/routes/index/NoServers.test.tsx renamed to test/app/routes/index/NoServers.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { render, screen } from '@testing-library/react';
22
import { fromPartial } from '@total-typescript/shoehorn';
33
import { MemoryRouter } from 'react-router';
4-
import type { SessionData } from '../../../app/auth/session-context';
5-
import { SessionProvider } from '../../../app/auth/session-context';
6-
import { NoServers } from '../../../app/routes/index/NoServers';
7-
import { checkAccessibility } from '../../__helpers__/accessibility';
4+
import type { SessionData } from '../../../../app/auth/session-context';
5+
import { SessionProvider } from '../../../../app/auth/session-context';
6+
import { NoServers } from '../../../../app/routes/index/NoServers';
7+
import { checkAccessibility } from '../../../__helpers__/accessibility';
88

99
describe('<NoServers />', () => {
1010
const setUp = (session: SessionData | null = null) => render(

0 commit comments

Comments
 (0)