test: улучшены описания тестов страницы просмотра заказа
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
- Добавлены более информативные описания тестовых сценариев - Улучшена читаемость тестов за счет детальных названий на русском языке
This commit is contained in:
parent
ebfaa7ea8f
commit
b77eccc8e8
@ -1,6 +1,6 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Order View page, initial load shows order details 1`] = `
|
exports[`Страница просмотра заказа отображает детали заказа после успешной загрузки 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="chakra-container css-3n6qh3"
|
class="chakra-container css-3n6qh3"
|
||||||
@ -126,7 +126,7 @@ exports[`Order View page, initial load shows order details 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Order View page, initial load shows order details loading 1`] = `
|
exports[`Страница просмотра заказа отображает индикатор загрузки деталей заказа 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="chakra-container css-3n6qh3"
|
class="chakra-container css-3n6qh3"
|
||||||
@ -171,7 +171,7 @@ exports[`Order View page, initial load shows order details loading 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`Order View page, initial load shows order error 1`] = `
|
exports[`Страница просмотра заказа отображает ошибку при некорректном ID заказа 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="chakra-container css-3n6qh3"
|
class="chakra-container css-3n6qh3"
|
||||||
|
@ -11,12 +11,12 @@ jest.mock('react-router-dom', () => ({
|
|||||||
useParams: jest.fn(),
|
useParams: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe.skip('Order View page, initial load', () => {
|
describe('Страница просмотра заказа', () => {
|
||||||
beforeAll(() => server.listen());
|
beforeAll(() => server.listen());
|
||||||
afterEach(() => server.resetHandlers());
|
afterEach(() => server.resetHandlers());
|
||||||
afterAll(() => server.close());
|
afterAll(() => server.close());
|
||||||
|
|
||||||
test('shows order details loading', () => {
|
test('отображает индикатор загрузки деталей заказа', () => {
|
||||||
(useParams as jest.Mock).mockReturnValue({ orderId: 'id1' });
|
(useParams as jest.Mock).mockReturnValue({ orderId: 'id1' });
|
||||||
|
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
@ -33,7 +33,7 @@ describe.skip('Order View page, initial load', () => {
|
|||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('shows order details', async () => {
|
test('отображает детали заказа после успешной загрузки', async () => {
|
||||||
(useParams as jest.Mock).mockReturnValue({ orderId: 'id1' });
|
(useParams as jest.Mock).mockReturnValue({ orderId: 'id1' });
|
||||||
|
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
@ -52,7 +52,7 @@ describe.skip('Order View page, initial load', () => {
|
|||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('shows order error', async () => {
|
test('отображает ошибку при некорректном ID заказа', async () => {
|
||||||
(useParams as jest.Mock).mockReturnValue({ orderId: null });
|
(useParams as jest.Mock).mockReturnValue({ orderId: null });
|
||||||
|
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
|
Loading…
Reference in New Issue
Block a user