From 0cefbab29e1a1f1542f0f039689ab2dc59693183 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 11 Mar 2021 14:42:35 -0500 Subject: [PATCH] Squashed commit of the following: commit 5a989840df8ad81b8671551d5ae2c288c2771817 Merge: 9369bd5 786fde9 Author: Josh Salisbury Date: Thu Mar 11 13:35:29 2021 -0600 Merge pull request #228 from adhocteam/js-fix-be-tests-again Fix backend tests again commit 786fde901295435095881697b4a38bb9b9735970 Author: Josh Salisbury Date: Thu Mar 11 13:23:05 2021 -0600 Try again to fix backend tests commit 9369bd5b9f31334810b5c459dd4c9a99bf6f9af5 Merge: 0c44259 de255ce Author: Josh Salisbury Date: Thu Mar 11 12:47:40 2021 -0600 Merge pull request #226 from adhocteam/js-fix-be-tests File upload test shouldn't error out commit de255ce27d7e49ea1e5ed4dafa62b490303b3994 Author: Josh Salisbury Date: Thu Mar 11 12:37:14 2021 -0600 File upload test shouldn't error out FileId is now set in a before each and should no longer depend on tests being ran in a specific order commit 0c44259e901435756b0336ae055d59713cbd91a6 Merge: fad3c70 30fb7c1 Author: Josh Salisbury Date: Thu Mar 11 11:35:55 2021 -0600 Merge pull request #213 from adhocteam/js-332-accessibility-updates Accessibility updates commit 30fb7c1ddb3f5f155d791178a45480da2cc11240 Merge: c1527c2 fad3c70 Author: Josh Salisbury Date: Thu Mar 11 10:04:26 2021 -0600 Merge branch 'main' into js-332-accessibility-updates Conflicts: frontend/src/pages/ActivityReport/Pages/goalsObjectives.js commit fad3c704f475050bde6fb62cce48355072a711c1 Merge: 79cab99 3090d99 Author: Ryan Ahearn Date: Thu Mar 11 10:50:12 2021 -0500 Merge pull request #225 from adhocteam/prod-domain-terraform Production domain terraform commit 3090d993fac0fc7b16496b1de03e0387927efe99 Merge: 7cac1b4 79cab99 Author: Ryan Ahearn Date: Thu Mar 11 10:41:25 2021 -0500 Merge branch 'main' into prod-domain-terraform commit 79cab995702c8637f12be61daf6a3561d557522c Merge: 49f75a5 f9914ca Author: Josh Salisbury Date: Thu Mar 11 09:39:47 2021 -0600 Merge pull request #216 from adhocteam/js-287-persist-goals-objectives Objectives/Goals are persisted commit c1527c20468ddc11a37df886d51bb8c84bd70b9b Merge: 9c6108f 49f75a5 Author: Josh Salisbury Date: Thu Mar 11 09:31:52 2021 -0600 Merge branch 'main' into js-332-accessibility-updates commit f9914ca6dcecf205d81e065ff0430c853ead6ae2 Author: Josh Salisbury Date: Thu Mar 11 09:29:34 2021 -0600 Return from migrations, remove granteeId from index Renamed migrations to ensure they are ran commit 7cac1b4fec6161eda1d205485bfd8a8f1df26c5f Merge: 01dafc4 49f75a5 Author: Ryan Ahearn Date: Thu Mar 11 10:22:42 2021 -0500 Merge branch 'main' into prod-domain-terraform commit e96c77d30bf8e4c7d6433c8e0e1b70f7ed88a64d Merge: 2f612d9 49f75a5 Author: Josh Salisbury Date: Thu Mar 11 09:13:48 2021 -0600 Merge branch 'main' into js-287-persist-goals-objectives commit 49f75a51cc4052a33493a5bf222f1a87bed0a13c Merge: bd830f9 72ea701 Author: Josh Salisbury Date: Thu Mar 11 09:10:30 2021 -0600 Merge pull request #221 from adhocteam/js-152-browser-controls Browser nav fix and various IE 11 fixes commit 01dafc410406351c00d6ec80fdc2ac4328ccd613 Author: Ryan Ahearn Date: Wed Mar 10 12:02:51 2021 -0500 Add route mapping for prod url commit a7822a964a43a1941df3da0ce1290d5db67f851b Author: Ryan Ahearn Date: Wed Mar 10 11:50:57 2021 -0500 Recursively delete non-prod infrastructure commit 72ea701fdfb6875c2c4db7783ea479bb4053246f Author: Josh Salisbury Date: Wed Mar 10 16:20:57 2021 -0600 Goal picker fix for IE 11 IE 11 doesn't place flex items properly when a `min-height` is used. Add a flag to the multiselect component allowing flagging it as a "single row" input to allow the goal picker to show up properly commit a2703293df7457ff023a908658ccf469c126dbe7 Author: Josh Salisbury Date: Wed Mar 10 15:31:47 2021 -0600 Attempt to force IE to not cache GET requests commit 2f612d99c075d76a5533ea233b190e663778102a Author: Josh Salisbury Date: Wed Mar 10 12:12:41 2021 -0600 Update activityReports query commit 9c6108f9aff5f13f4ad4268a1b863805b89bc532 Merge: e1b9f45 bd830f9 Author: Josh Salisbury Date: Wed Mar 10 11:44:27 2021 -0600 Merge branch 'main' into js-332-accessibility-updates commit 81d795bec8f9b69943df94ab1fa401b6614e3ac4 Author: Josh Salisbury Date: Wed Mar 10 11:43:00 2021 -0600 Lint fix commit 3d6b908ddb60b22267c8cc258384b7eb368da3a9 Merge: 2b0ed3d bd830f9 Author: Josh Salisbury Date: Wed Mar 10 11:40:02 2021 -0600 Merge branch 'main' into js-287-persist-goals-objectives commit bd6ce103db6187e0681ce71bda8da1f35ed81ee7 Merge: d3fcd83 bd830f9 Author: Josh Salisbury Date: Wed Mar 10 11:33:49 2021 -0600 Merge branch 'main' into js-152-browser-controls commit d3fcd838fb70e83690b5321bea5d962cfaac73c4 Merge: f0c8908 87790f3 Author: Josh Salisbury Date: Wed Mar 10 11:32:35 2021 -0600 Merge branch 'js-152-browser-controls' of github.com:adhocteam/Head-Start-TTADP into js-152-browser-controls commit f0c890829015d7572f8324b53c47b48954d7d034 Author: Josh Salisbury Date: Wed Mar 10 11:32:16 2021 -0600 Use ie11 version of react-hook-form commit 87790f34f4e2e2eb9e9992604fbee0a4d2146f4b Merge: 91933c6 5e867d8 Author: Ryan Ahearn Date: Tue Mar 9 19:13:05 2021 -0500 Merge branch 'main' into js-152-browser-controls commit 91933c6ff511a651435a93504a983cc34f281548 Merge: b9a17b4 58723e1 Author: Josh Salisbury Date: Tue Mar 9 16:15:18 2021 -0600 Merge branch 'js-152-browser-controls' of github.com:adhocteam/Head-Start-TTADP into js-152-browser-controls Conflicts: .circleci/config.yml commit b9a17b4290d330b3ec087e7717122cde7983d36d Author: Josh Salisbury Date: Tue Mar 9 16:13:37 2021 -0600 Update sandbox branch commit 58723e154dab4834c4930fb6681267dbda8c2b3f Merge: d671ba4 bcca11c Author: Josh Salisbury Date: Tue Mar 9 15:40:45 2021 -0600 Merge branch 'main' into js-152-browser-controls commit d671ba4f097cd7fb584ee17e06180e563739a53d Author: Josh Salisbury Date: Tue Mar 9 11:34:08 2021 -0600 Browser nav fix and various IE 11 fixes * Push nav state instead of replace on navigation. This means the back/forward browser buttons work * Goal picker sets height = min height for the controller, this makes the text inside the textbox center properly in ie11 * react-uswds ^1.12.2 was causing the page to not load in ie11. Downgrade to 1.11.0 * Hex colors with transparency weren't playing nice with ie11, converted to rgba * Padding-inline wasn't working in ie11, switch to padding-left * Duration validation updated to actually force durations rounded to the half hour * Goal multiselect only displays "x goals selected" if there is no user input * Objectives are only focused on mount instead of when the ref changes. Fixes a bug where focus switches back to the objective after switching off commit e1b9f45bfdbda18ad18e45500891d0f01a8bdce9 Merge: 84f3d0e 5956089 Author: Josh Salisbury Date: Tue Mar 9 09:35:42 2021 -0600 Merge branch 'main' into js-332-accessibility-updates commit 2b0ed3dd3ff8119509d88c8659904aaf7b0602a4 Merge: feb5da6 5956089 Author: Josh Salisbury Date: Tue Mar 9 09:35:37 2021 -0600 Merge branch 'main' into js-287-persist-goals-objectives commit 84f3d0e26b101dd3fe543fd0b1ef03b26fd0015d Merge: 946bfcb e7db658 Author: Josh Salisbury Date: Mon Mar 8 13:19:51 2021 -0600 Merge branch 'main' into js-332-accessibility-updates commit feb5da6f555fb802d0a3b029225ee784dd36686e Merge: 718956c e7db658 Author: Josh Salisbury Date: Mon Mar 8 11:57:19 2021 -0600 Merge branch 'main' into js-287-persist-goals-objectives commit 718956c8770ea24d04e041e4205940f4d180afdb Author: Josh Salisbury Date: Mon Mar 8 11:56:35 2021 -0600 Handle report switching from grantee to non-grantee commit cb1b86584be577a2652ccb3b64e94bc9a859494a Author: Josh Salisbury Date: Mon Mar 8 11:04:45 2021 -0600 Objectives/Goals are persisted * When a report is saved the goals and objectives from the report are saved to the DB, udpated or created if needed * An ActivityReportObjective record is created for every objective associating the report to objective * Objectives that are no longer used in the report are removed from the DB, along with the ActivityReportObjective * If the goal hasn't been used on a previous report and is removed from the current report it is also removed * When a report is approved a GrantGoal record is created for every goal/grant pair commit 946bfcb3d6a5b5ac5090d0e407ce40cef048dbc3 Author: Josh Salisbury Date: Thu Mar 4 17:02:11 2021 -0600 Update tests commit a2ef84133608a5f30108354180303b45e64d216e Author: Josh Salisbury Date: Thu Mar 4 16:43:16 2021 -0600 Update sandbox branch commit edccb36dd6961aca04ca09ec2a9f7081b6e4f6a1 Author: Josh Salisbury Date: Thu Mar 4 16:26:41 2021 -0600 Address accessibility issues * Side nav aria-label removed so the complete entry is read by screen readers * DatePicker has more helpful text announced by screen readers * Duration label is clearer * Save noticiation message is more generic and the whole message is read instead of just the updated date/time * Goal selector no longer eats tabs and can be navigated out of by a keyboard * Skip nav link placed on top of header when focused --- src/routes/files/handlers.test.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/routes/files/handlers.test.js b/src/routes/files/handlers.test.js index 9aec3dad6e..73fa96c0b1 100644 --- a/src/routes/files/handlers.test.js +++ b/src/routes/files/handlers.test.js @@ -99,11 +99,6 @@ describe('File Upload', () => { it('tests a file upload', async () => { expect(uploadFile).toHaveBeenCalled(); expect(mockAddToScanQueue).toHaveBeenCalled(); - }); - it('checks the metadata was uploaded to the database', async () => { - ActivityReportPolicy.mockImplementation(() => ({ - canUpdate: () => true, - })); const file = await File.findOne({ where: { id: fileId } }); const uuid = file.dataValues.key.slice(0, -4); expect(file.dataValues.id).toBe(fileId); @@ -117,7 +112,7 @@ describe('File Upload', () => { canUpdate: () => false, })); await request(app) - .delete(`/api/files/${report.dataValues.id}/${fileId}`) + .delete(`/api/files/${report.dataValues.id}/1`) .expect(403) .then(() => expect(deleteFileFromS3).not.toHaveBeenCalled()); }); @@ -125,12 +120,18 @@ describe('File Upload', () => { ActivityReportPolicy.mockImplementation(() => ({ canUpdate: () => true, })); - const file = await File.findOne({ where: { id: fileId } }); + const file = await File.create({ + activityReportId: report.dataValues.id, + originalFileName: 'name', + key: 'key', + status: 'UPLOADING', + fileSize: 0, + }); await request(app) - .delete(`/api/files/${report.dataValues.id}/${fileId}`) + .delete(`/api/files/${report.dataValues.id}/${file.id}`) .expect(204); expect(deleteFileFromS3).toHaveBeenCalledWith(file.dataValues.key); - const noFile = await File.findOne({ where: { id: fileId } }); + const noFile = await File.findOne({ where: { id: file.id } }); expect(noFile).toBe(null); }); });