-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add create and mutual update tests
- Loading branch information
Showing
3 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,7 +364,6 @@ computed_columns/form_change_actual_performance_milestone_amount [computed_colum | |
functions/handle_milestone_form_change_commit [functions/[email protected]] 2023-09-29T20:17:51Z Sepehr Sobhani <[email protected]> # Update commit handler to fix the issue with archiving milestones | ||
@1.15.0 2023-10-03T21:35:32Z Sepehr Sobhani <[email protected]> # release v1.15.0 | ||
@1.16.0 2023-10-24T17:15:40Z Dylan Leard <[email protected]> # release v1.16.0 | ||
|
||
functions/jsonb_minus 2023-10-30T19:55:55Z Mike Vesprini <[email protected]> # Function to provide the object difference between two jsonb objects | ||
mutations/commit_form_change_internal [mutations/[email protected]] 2023-10-30T21:34:15Z Mike Vesprini <[email protected]> # Handle rebasing when committing with another pending revision on the same project" | ||
mutations/commit_project_revision [mutations/[email protected]] 2023-10-31T00:07:01Z Mike Vesprini <[email protected]> # Update function to pass new parameters to commit_form_change_internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
begin; | ||
|
||
select plan(10); | ||
select plan(11); | ||
|
||
/** SETUP **/ | ||
truncate cif.form_change restart identity; | ||
|
@@ -80,7 +80,7 @@ select is( | |
|
||
-- Test the concurrent revision functinality | ||
|
||
truncate table cif.project, cif.operator restart identity cascade; | ||
truncate table cif.project, cif.operator, cif.contact restart identity cascade; | ||
insert into cif.operator(legal_name) values ('test operator'); | ||
insert into cif.contact(given_name, family_name, email) values ('John', 'Test', '[email protected]'); | ||
|
||
|
@@ -122,8 +122,11 @@ update cif.form_change set new_form_data='{ | |
where project_revision_id=3 | ||
and form_data_table_name='project'; | ||
|
||
select cif.add_contact_to_revision(3, 1, 1); | ||
|
||
select cif.commit_project_revision(3); | ||
|
||
-- Both committing and pending project revisions have made changes to the project form. | ||
select is ( | ||
(select new_form_data->>'projectName' from cif.form_change where project_revision_id = 2 and form_data_table_name = 'project'), | ||
'Correct', | ||
|
@@ -142,6 +145,12 @@ select is ( | |
'When the commiting form change has updated a field that the pending has not, it updates the pending form change' | ||
); | ||
|
||
select is ( | ||
(select new_form_data from cif.form_change where project_revision_id = 2 and form_data_table_name = 'project_contact'), | ||
'{"contactId": 1, "projectId": 1, "contactIndex": 1}'::jsonb, | ||
'When the committing form change has an operation create, the resource also gets created in the pending revision' | ||
); | ||
|
||
-- Commit the ammednment | ||
select cif.commit_project_revision(2); | ||
|
||
|