Skip to content

Commit

Permalink
feat: mocking date on e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Mar 9, 2021
1 parent ebcc911 commit 817071c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/cypress/integration/search-tables.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ describe('When filtering organisation requests', () => {
before(() => {
cy.cleanSchema();
cy.sqlFixture('fixtures/search-setup');
cy.useMockedTime(new Date('June 10, 2020 09:00:00'));
});

it('can be filtered by a numeric search', () => {
Expand Down
4 changes: 4 additions & 0 deletions schema/data/fixtures/search-setup.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
begin;

-- Mock time for the test
select mocks.set_mocked_time_in_transaction('2099-02-02 00:01:00.000000-07'::timestamptz);

-- Init test environment
select test_helper.mock_open_window();
select test_helper.modify_triggers('disable');
Expand All @@ -18,6 +21,7 @@ insert into ggircs_portal.application_revision_status(application_id, version_nu
insert into ggircs_portal.application_revision_status(application_id, version_number, application_revision_status, created_at)
values (3,1,'approved', now() + interval '1 minute');


-- Create organisation access requests
insert into ggircs_portal.ciip_user_organisation(user_id, organisation_id, status)
values (1, 1, 'approved');
Expand Down

0 comments on commit 817071c

Please sign in to comment.