mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-24 04:08:10 +00:00
added tests for filtering by multiple statuses
This commit is contained in:
parent
7bc0c98629
commit
158e36db63
@ -156,23 +156,18 @@ describe('process-instances', () => {
|
|||||||
|
|
||||||
PROCESS_STATUSES.forEach((processStatus) => {
|
PROCESS_STATUSES.forEach((processStatus) => {
|
||||||
if (!['all', 'waiting'].includes(processStatus)) {
|
if (!['all', 'waiting'].includes(processStatus)) {
|
||||||
cy.getBySel('process-status-dropdown')
|
cy.get('[name=process-status-selection]').click();
|
||||||
.type('typing_to_open_dropdown_box....FIXME')
|
cy.get('[name=process-status-selection]').type(processStatus);
|
||||||
.find('.dropdown-item')
|
cy.get(`[aria-label=${processStatus}]`).click();
|
||||||
.contains(new RegExp(`^${processStatus}$`))
|
cy.contains('Process Status').click();
|
||||||
.click();
|
|
||||||
cy.contains('Filter').click();
|
cy.contains('Filter').click();
|
||||||
cy.assertAtLeastOneItemInPaginatedResults();
|
cy.assertAtLeastOneItemInPaginatedResults();
|
||||||
cy.getBySel(`process-instance-status-${processStatus}`).contains(
|
cy.getBySel(`process-instance-status-${processStatus}`).contains(
|
||||||
processStatus
|
processStatus
|
||||||
);
|
);
|
||||||
|
cy.get('button[aria-label=Remove]').click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cy.getBySel('process-status-dropdown')
|
|
||||||
.type('typing_to_open_dropdown_box....FIXME')
|
|
||||||
.find('.dropdown-item')
|
|
||||||
.contains('all')
|
|
||||||
.click();
|
|
||||||
|
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setHours(date.getHours() - 1);
|
date.setHours(date.getHours() - 1);
|
||||||
|
@ -6,19 +6,11 @@ import {
|
|||||||
useSearchParams,
|
useSearchParams,
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
|
|
||||||
import {
|
import { Button, Table, Stack, Form, InputGroup } from 'react-bootstrap';
|
||||||
Button,
|
|
||||||
Table,
|
|
||||||
Stack,
|
|
||||||
Dropdown,
|
|
||||||
Form,
|
|
||||||
InputGroup,
|
|
||||||
} from 'react-bootstrap';
|
|
||||||
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
||||||
import DatePicker from 'react-datepicker';
|
import DatePicker from 'react-datepicker';
|
||||||
import { Typeahead } from 'react-bootstrap-typeahead';
|
import { Typeahead } from 'react-bootstrap-typeahead';
|
||||||
import { Option } from 'react-bootstrap-typeahead/types/types';
|
import { Option } from 'react-bootstrap-typeahead/types/types';
|
||||||
import { stringify } from 'querystring';
|
|
||||||
import { PROCESS_STATUSES, DATE_FORMAT } from '../config';
|
import { PROCESS_STATUSES, DATE_FORMAT } from '../config';
|
||||||
import {
|
import {
|
||||||
convertDateToSeconds,
|
convertDateToSeconds,
|
||||||
@ -81,6 +73,7 @@ export default function ProcessInstanceList() {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function setProcessInstancesFromResult(result: any) {
|
function setProcessInstancesFromResult(result: any) {
|
||||||
const processInstancesFromApi = result.results;
|
const processInstancesFromApi = result.results;
|
||||||
@ -300,10 +293,14 @@ export default function ProcessInstanceList() {
|
|||||||
Process Status:{' '}
|
Process Status:{' '}
|
||||||
</InputGroup.Text>
|
</InputGroup.Text>
|
||||||
<Typeahead
|
<Typeahead
|
||||||
|
multiple
|
||||||
style={{ width: 500 }}
|
style={{ width: 500 }}
|
||||||
id="process-status-selection"
|
id="process-status-selection"
|
||||||
|
// for cypress tests since data-qa does not work
|
||||||
|
inputProps={{
|
||||||
|
name: 'process-status-selection',
|
||||||
|
}}
|
||||||
labelKey="label"
|
labelKey="label"
|
||||||
multiple
|
|
||||||
onChange={setProcessStatusSelection}
|
onChange={setProcessStatusSelection}
|
||||||
options={processStatuseSelectionOptions}
|
options={processStatuseSelectionOptions}
|
||||||
placeholder="Choose process statuses..."
|
placeholder="Choose process statuses..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user