Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/form input required #764

Merged
merged 6 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,37 @@ describe('submit task', () => {
const appBar = await getAppBar();
await (await appBar.$('button[aria-label="System Overview"]')).click();
await (await appBar.$('button[aria-label="new task"]')).click();
await (await $('#task-type')).click();
const getPatrolOption = async () => {
const options = await $$('[role=option]');
for (const opt of options) {
const text = await opt.getText();
if (text === 'Patrol') {
return opt;
}
}
return null;
};
await browser.waitUntil(async () => !!(await getPatrolOption()));
const patrolOption = (await getPatrolOption())!;
await patrolOption.click();

await (await $('#place-input')).click();
const getCoeOption = async () => {
const options = await $$('[role=option]');
for (const opt of options) {
const text = await opt.getText();
if (text === 'coe') {
return opt;
}
}
return null;
};
await browser.waitUntil(async () => !!(await getCoeOption()));
const coeOption = (await getCoeOption())!;
await coeOption.click();

await (await $('button[aria-label="Submit Now"]')).click();
await expect($('div=Successfully created task')).toBeDisplayed();
});
}).timeout(60000);
});
15 changes: 14 additions & 1 deletion packages/dashboard-e2e/tests/ui-interactions/submit-task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ describe('submit task', () => {
const patrolOption = (await getPatrolOption())!;
await patrolOption.click();

await (await $('#place-input')).setValue('coe');
await (await $('#place-input')).click();
const getCoeOption = async () => {
const options = await $$('[role=option]');
for (const opt of options) {
const text = await opt.getText();
if (text === 'coe') {
return opt;
}
}
return null;
};
await browser.waitUntil(async () => !!(await getCoeOption()));
const coeOption = (await getCoeOption())!;
await coeOption.click();

await (await $('button[aria-label="Submit Now"]')).click();
await expect($('div=Successfully created task')).toBeDisplayed();
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/lib/form-inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function PositiveIntField({ value = 0, onChange, ...props }: PositiveIntF
{...props}
type="number"
value={valueInput}
inputProps={{ min: 0 }}
inputProps={{ min: 1 }}
onKeyDown={(ev) => {
if ('-+.'.indexOf(ev.key) >= 0) {
ev.preventDefault();
Expand Down
Loading
Loading