mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-08 23:54:10 +00:00
process instance cypress tests pass now w/ burnettk
This commit is contained in:
parent
97ef915944
commit
c1c95aafa5
@ -165,34 +165,34 @@ describe('process-instances', () => {
|
|||||||
cy.basicPaginationTest();
|
cy.basicPaginationTest();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('can filter', () => {
|
it('can filter', () => {
|
||||||
cy.getBySel('process-instance-list-link').click();
|
cy.getBySel('process-instance-list-link').click();
|
||||||
cy.assertAtLeastOneItemInPaginatedResults();
|
cy.assertAtLeastOneItemInPaginatedResults();
|
||||||
|
|
||||||
// PROCESS_STATUSES.forEach((processStatus) => {
|
PROCESS_STATUSES.forEach((processStatus) => {
|
||||||
// if (!['all', 'waiting'].includes(processStatus)) {
|
if (!['all', 'waiting'].includes(processStatus)) {
|
||||||
// cy.get('#process-instance-status-select').click();
|
cy.get('#process-instance-status-select').click();
|
||||||
// cy.get('#process-instance-status-select')
|
cy.get('#process-instance-status-select')
|
||||||
// .contains(processStatus)
|
.contains(processStatus)
|
||||||
// .click();
|
.click();
|
||||||
// // close the dropdown again
|
// close the dropdown again
|
||||||
// cy.get('#process-instance-status-select').click();
|
cy.get('#process-instance-status-select').click();
|
||||||
// cy.getBySel('filter-button').click();
|
cy.getBySel('filter-button').click();
|
||||||
// cy.assertAtLeastOneItemInPaginatedResults();
|
cy.assertAtLeastOneItemInPaginatedResults();
|
||||||
// cy.getBySel(`process-instance-status-${processStatus}`).contains(
|
cy.getBySel(`process-instance-status-${processStatus}`).contains(
|
||||||
// processStatus
|
processStatus
|
||||||
// );
|
);
|
||||||
// // there should really only be one, but in CI there are sometimes more
|
// there should really only be one, but in CI there are sometimes more
|
||||||
// cy.get('div[aria-label="Clear all selected items"]:first').click();
|
cy.get('div[aria-label="Clear all selected items"]:first').click();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setHours(date.getHours() - 1);
|
date.setHours(date.getHours() - 1);
|
||||||
filterByDate(date);
|
filterByDate(date);
|
||||||
cy.assertAtLeastOneItemInPaginatedResults();
|
cy.assertAtLeastOneItemInPaginatedResults();
|
||||||
|
|
||||||
date.setHours(date.getHours() + 2);
|
date.setHours(date.getHours() + 26);
|
||||||
filterByDate(date);
|
filterByDate(date);
|
||||||
cy.assertNoItemInPaginatedResults();
|
cy.assertNoItemInPaginatedResults();
|
||||||
});
|
});
|
||||||
|
@ -118,7 +118,7 @@ Cypress.Commands.add('assertAtLeastOneItemInPaginatedResults', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('assertNoItemInPaginatedResults', () => {
|
Cypress.Commands.add('assertNoItemInPaginatedResults', () => {
|
||||||
cy.getBySel('total-paginated-items').contains('0');
|
cy.contains(/\b0–0 of 0 items/);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('modifyProcessModelPath', (path) => {
|
Cypress.Commands.add('modifyProcessModelPath', (path) => {
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
import { slugifyString } from './helpers';
|
import { convertSecondsToFormattedDate, slugifyString } from './helpers';
|
||||||
|
|
||||||
test('it can slugify a string', () => {
|
test('it can slugify a string', () => {
|
||||||
expect(slugifyString('hello---world_ and then Some such-')).toEqual(
|
expect(slugifyString('hello---world_ and then Some such-')).toEqual(
|
||||||
'hello-world-and-then-some-such'
|
'hello-world-and-then-some-such'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it can keep the correct date when converting seconds to date', () => {
|
||||||
|
const dateString = convertSecondsToFormattedDate(1666325400);
|
||||||
|
expect(dateString).toEqual('2022-10-21');
|
||||||
|
});
|
||||||
|
@ -44,7 +44,9 @@ export const convertDateToSeconds = (
|
|||||||
|
|
||||||
export const convertStringToDate = (dateString: string) => {
|
export const convertStringToDate = (dateString: string) => {
|
||||||
if (dateString) {
|
if (dateString) {
|
||||||
return new Date(dateString);
|
// add midnight time to the date so it c uses the correct date
|
||||||
|
// after converting to timezone
|
||||||
|
return new Date(`${dateString}T00:10:00`);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user