@@ -109,7 +124,9 @@ vi.mock('@mantine/dropzone', () => ({
data-accept={accept}
data-max-size={maxSize}
onClick={() => {
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
onDrop([file]);
}}
>
@@ -188,7 +205,11 @@ describe('PluginsPage', () => {
});
it('shows loader when loading and no plugins', () => {
- const loadingState = { plugins: [], loading: true, fetchPlugins: vi.fn() };
+ const loadingState = {
+ plugins: [],
+ loading: true,
+ fetchPlugins: vi.fn(),
+ };
usePluginStore.mockImplementation((selector) => {
return selector ? selector(loadingState) : loadingState;
});
@@ -219,7 +240,9 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
expect(screen.getByTestId('modal')).toBeInTheDocument();
- expect(screen.getByTestId('modal-title')).toHaveTextContent('Import Plugin');
+ expect(screen.getByTestId('modal-title')).toHaveTextContent(
+ 'Import Plugin'
+ );
});
it('shows dropzone and file input in import modal', () => {
@@ -228,7 +251,9 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
expect(screen.getByTestId('dropzone')).toBeInTheDocument();
- expect(screen.getByPlaceholderText('Select plugin .zip')).toBeInTheDocument();
+ expect(
+ screen.getByPlaceholderText('Select plugin .zip')
+ ).toBeInTheDocument();
});
it('closes import modal when close button is clicked', () => {
@@ -245,7 +270,11 @@ describe('PluginsPage', () => {
it('handles file upload via dropzone', async () => {
importPlugin.mockResolvedValue({
success: true,
- plugin: { key: 'new-plugin', name: 'New Plugin', description: 'New Description' },
+ plugin: {
+ key: 'new-plugin',
+ name: 'New Plugin',
+ description: 'New Description',
+ },
});
render(
);
@@ -255,9 +284,9 @@ describe('PluginsPage', () => {
fireEvent.click(dropzone);
await waitFor(() => {
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
expect(uploadButton).not.toBeDisabled();
});
});
@@ -279,12 +308,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -305,12 +336,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -340,12 +373,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -372,12 +407,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -387,9 +424,9 @@ describe('PluginsPage', () => {
const enableSwitch = screen.getByRole('checkbox');
fireEvent.click(enableSwitch);
- const enableButton = screen.getAllByText('Enable').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const enableButton = screen
+ .getAllByText('Enable')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(enableButton);
await waitFor(() => {
@@ -417,12 +454,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -432,13 +471,15 @@ describe('PluginsPage', () => {
const enableSwitch = screen.getByRole('checkbox');
fireEvent.click(enableSwitch);
- const enableButton = screen.getAllByText('Enable').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const enableButton = screen
+ .getAllByText('Enable')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(enableButton);
await waitFor(() => {
- expect(screen.getByText('Enable third-party plugins?')).toBeInTheDocument();
+ expect(
+ screen.getByText('Enable third-party plugins?')
+ ).toBeInTheDocument();
});
});
@@ -460,12 +501,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -475,9 +518,9 @@ describe('PluginsPage', () => {
const enableSwitch = screen.getByRole('checkbox');
fireEvent.click(enableSwitch);
- const enableButton = screen.getAllByText('Enable').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const enableButton = screen
+ .getAllByText('Enable')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(enableButton);
await waitFor(() => {
@@ -508,12 +551,14 @@ describe('PluginsPage', () => {
fireEvent.click(screen.getByText('Import Plugin'));
const fileInput = screen.getByPlaceholderText('Select plugin .zip');
- const file = new File(['content'], 'plugin.zip', { type: 'application/zip' });
+ const file = new File(['content'], 'plugin.zip', {
+ type: 'application/zip',
+ });
fireEvent.change(fileInput, { target: { files: [file] } });
- const uploadButton = screen.getAllByText('Upload').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const uploadButton = screen
+ .getAllByText('Upload')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(uploadButton);
await waitFor(() => {
@@ -523,9 +568,9 @@ describe('PluginsPage', () => {
const enableSwitch = screen.getByRole('checkbox');
fireEvent.click(enableSwitch);
- const enableButton = screen.getAllByText('Enable').find(btn =>
- btn.tagName === 'BUTTON'
- );
+ const enableButton = screen
+ .getAllByText('Enable')
+ .find((btn) => btn.tagName === 'BUTTON');
fireEvent.click(enableButton);
await waitFor(() => {
diff --git a/frontend/src/pages/__tests__/Users.test.jsx b/frontend/src/pages/__tests__/Users.test.jsx
index 3ee63627..b7ab4ae2 100644
--- a/frontend/src/pages/__tests__/Users.test.jsx
+++ b/frontend/src/pages/__tests__/Users.test.jsx
@@ -5,7 +5,7 @@ import useAuthStore from '../../store/auth';
vi.mock('../../store/auth');
vi.mock('../../components/tables/UsersTable', () => ({
- default: () =>
UsersTable
+ default: () =>
UsersTable
,
}));
vi.mock('@mantine/core', () => ({
Box: ({ children, ...props }) =>
{children}
,
diff --git a/frontend/src/pages/__tests__/VODs.test.jsx b/frontend/src/pages/__tests__/VODs.test.jsx
index 6e7c00ec..a4d74337 100644
--- a/frontend/src/pages/__tests__/VODs.test.jsx
+++ b/frontend/src/pages/__tests__/VODs.test.jsx
@@ -16,7 +16,7 @@ vi.mock('../../components/SeriesModal', () => ({
{series?.name}
- ) : null
+ ) : null,
}));
vi.mock('../../components/VODModal', () => ({
default: ({ opened, vod, onClose }) =>
@@ -25,26 +25,30 @@ vi.mock('../../components/VODModal', () => ({