-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathhelpers.tsx
More file actions
55 lines (47 loc) · 1.31 KB
/
helpers.tsx
File metadata and controls
55 lines (47 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react';
import { screen } from '@testing-library/react';
import {
clearWithWait,
renderWithRedux,
typeWithWait,
type UserEventInstance,
type WizardStateOverrides,
} from '@/test/testUtils';
import DetailsStep from '../index';
export const renderDetailsStep = (
wizardStateOverrides: WizardStateOverrides = {},
) => {
return renderWithRedux(<DetailsStep />, wizardStateOverrides);
};
export const enterBlueprintName = async (
user: UserEventInstance,
name: string,
) => {
const input = await screen.findByRole('textbox', {
name: /name/i,
});
await clearWithWait(user, input);
await typeWithWait(user, input, name);
};
export const enterBlueprintDescription = async (
user: UserEventInstance,
description: string,
) => {
const input = await screen.findByRole('textbox', {
name: /description/i,
});
await clearWithWait(user, input);
await typeWithWait(user, input, description);
};
export const clearBlueprintName = async (user: UserEventInstance) => {
const input = await screen.findByRole('textbox', {
name: /name/i,
});
await clearWithWait(user, input);
};
export const clearBlueprintDescription = async (user: UserEventInstance) => {
const input = await screen.findByRole('textbox', {
name: /description/i,
});
await clearWithWait(user, input);
};