Add app test
This commit is contained in:
parent
cfdbbb7085
commit
d875e33f93
2 changed files with 36 additions and 1 deletions
|
@ -1,2 +1,3 @@
|
||||||
VITE_API_FETCH_URL=http://localhost:5000
|
VITE_API_FETCH_URL=http://localhost:5000
|
||||||
VITE_API_POST_URL=http://localhost:5000
|
VITE_API_SET_CONTAINER_LIST_URL=http://localhost:5000/SetContainerList
|
||||||
|
VITE_API_GET_FEEDBACK_URL=http://localhost:5000/GetFeedback
|
34
src/Components/App/App.test.tsx
Normal file
34
src/Components/App/App.test.tsx
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import * as React from 'react';
|
||||||
|
import { loadEnv } from 'vite';
|
||||||
|
import { beforeEach, describe, expect, it } from 'vitest';
|
||||||
|
import { fireEvent, render, RenderResult, screen } from '../../utils/test-utils';
|
||||||
|
import { App } from './App';
|
||||||
|
|
||||||
|
describe.concurrent('App', () => {
|
||||||
|
let app: RenderResult;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
app = render(
|
||||||
|
<App root={document} />
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('New editor', async() => {
|
||||||
|
const start = app.getByText(/Start from scratch/i);
|
||||||
|
fireEvent.click(start);
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
it('Load editor by file', () => {
|
||||||
|
const load = app.getByText(/Load a configuration file/i);
|
||||||
|
fireEvent.click(load);
|
||||||
|
|
||||||
|
const goBack = app.getByText(/Go back/i);
|
||||||
|
fireEvent.click(goBack);
|
||||||
|
|
||||||
|
const load2 = app.getByText(/Load a configuration file/i);
|
||||||
|
fireEvent.click(load2);
|
||||||
|
|
||||||
|
const chooseFile = app.getByText(/Import Save/i);
|
||||||
|
const inputFile: HTMLInputElement = document.querySelector('input[type="file"]') as HTMLInputElement;
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue