Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haar 2007 integration testing #37

Closed
wants to merge 245 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
2f73e58
Initial commit
andrewrlee Nov 12, 2020
c89f6f8
Alee/init (#1)
andrewrlee Nov 19, 2020
472adbb
Fixing docker image (#2)
andrewrlee Nov 19, 2020
36a57e7
Fix secret name (#3)
andrewrlee Nov 19, 2020
8683f28
Correcting variable names and removing unnecessary ones (#4)
andrewrlee Nov 19, 2020
418349e
Fixing variable name (#5)
andrewrlee Nov 19, 2020
c2af2d4
Removing trailing slashes from env vars (#6)
andrewrlee Nov 19, 2020
49ace58
Fix hostname (#7)
andrewrlee Nov 19, 2020
ccc0c03
Update dependencies (#8)
andrewrlee Dec 7, 2020
ac0dfa6
Reducing docker image size (#9)
andrewrlee Dec 15, 2020
c8a5587
Add rename script (#10)
andrewrlee Dec 18, 2020
1a11c21
Alee/decoupling auth client from redis (#11)
andrewrlee Dec 21, 2020
ec4f5ed
Update to latest hmpps orb version (#12)
mattops Jan 11, 2021
27a10a5
Fixing build-info.json placement (#13)
brightonsbox Jan 12, 2021
1ac0a0c
Convert to arrow functions in utils (#14)
psoleckimoj Jan 26, 2021
b3713ee
Make the use of logger naming consistent (#15)
psoleckimoj Jan 27, 2021
61b41df
Adding outdated job (#16)
andrewrlee Feb 18, 2021
594b004
Updating dependencies (#17)
andrewrlee Mar 5, 2021
a581d49
Moving to enable no-implicit-any (#18)
andrewrlee Mar 5, 2021
db09442
DT-1659: 🔨 Remove helm copying secrets from AWS (#19)
petergphillips Mar 8, 2021
716fdfb
Adding moj design system (#20)
andrewrlee Mar 17, 2021
8a43d6d
Add new veracode scan for schedueled workflow (#21)
mattops Mar 19, 2021
9fefb8f
Removing deprecated body parser (#22)
andrewrlee Mar 25, 2021
e8532ef
DT-1627: 📄 Update license with correct year (#23)
petergphillips May 11, 2021
cf8f8d7
Added missing ping endpoint as used by Kubernetes for liveliness prob…
andymarke May 12, 2021
ea38330
DT-2012 - upgrade hmpps orb, and add veracode policy scan job. (#25)
mattops May 14, 2021
e7df526
Use generic-service and generic-prometheus-alerts charts (#26)
mattops May 18, 2021
a2d85cd
Updating dependencies and adding slack notifications to outdated chec…
andrewrlee May 24, 2021
336b8fa
Moving to group middleware into related modules, following the patter…
andrewrlee May 28, 2021
5f29995
Fix the slack notification on `check_outdated` (#30)
Jun 4, 2021
3ef04f5
Updating node dependencies (#31)
andrewrlee Jun 16, 2021
5e81ee3
Fixing configuration of security audit (#32)
brightonsbox Jun 16, 2021
2003f62
Alee/update dependencies (#33)
andrewrlee Jun 24, 2021
3d93d8e
DT-2166 - add trivy image scanning job (#35)
mattops Jun 28, 2021
96d73dc
Fix trivy scan job slack notifications channel (#36)
mattops Jun 28, 2021
f541d64
Use node executor and parameterise the version (#34)
markreesmoj Jun 28, 2021
0d87899
Deploy template project to template k8s namespace (#37)
mattops Jun 30, 2021
4422c3f
DT-2260 - update to latest circleci orb and chart dependencies (#38)
mattops Jun 30, 2021
bc34e5f
Updating dependencies and improving README (#39)
andrewrlee Jul 1, 2021
e9450ed
DT-2282: ⬆️ Fix veracode policy scan (#40)
petergphillips Jul 6, 2021
7fd93c9
Moving cypress tests to typescript (#41)
andrewrlee Jul 27, 2021
264f33f
DT-2404: 💄 Switch to sign in / out instead of login / out (#42)
petergphillips Aug 6, 2021
fb0d2d0
DT-2404: ✅ Run tests automatically on commit (#43)
petergphillips Aug 6, 2021
80eee9d
Update dependencies (#44)
andrewrlee Aug 16, 2021
f41de78
DT-2297 - Veracode - switch to daily pipeline scan (results in circle…
mattops Aug 19, 2021
f5d881e
DT-2297- randomise timing of circleci security workflow due to rate l…
mattops Aug 24, 2021
17a4437
update typescript (#48)
connormaglynn Sep 1, 2021
4a64ef0
Fixing docker caching apt-get layer (#49)
andrewrlee Sep 6, 2021
dd68b5d
Fix docker build failing, and reduce image size (#50)
mattops Sep 7, 2021
94db4f2
Remove use of semi colons before arrays (#51)
garethmdavies Sep 29, 2021
d7d9133
WFP-610 update to npmv7 and fix some audit (#52)
markreesmoj Oct 7, 2021
2115d45
WFP-610 upgrade to jest-junit 13 to bring in new ansi-regex (#54)
markreesmoj Oct 8, 2021
5946417
Upgrading dependencies (#55)
andrewrlee Oct 8, 2021
223e269
FIXBUILD: update ansi-regex subdependency (#56)
markreesmoj Oct 11, 2021
d943820
DT-2702: 🔨 Use new generic service configuration (#57)
petergphillips Oct 11, 2021
349bdb7
Update dependencies (#58)
andrewrlee Oct 14, 2021
aa16d4a
Moving to use HMPPS header (#59)
brightonsbox Oct 20, 2021
cc41f5d
Fix path of unit test results that are uploaded as artifacts (#60)
ushkarev Oct 20, 2021
6ff0d36
DT-2814: 🐛 Fix cron timings for veracode (#61)
petergphillips Nov 3, 2021
a6c72ba
NN-3747 fixing json structure for the stubUserRoles call and populati…
Nov 5, 2021
f247b8a
Bumping node version (#63)
andrewrlee Nov 10, 2021
db9a433
DT-2796: 🔨 Migrate dev to live context (#64)
petergphillips Nov 18, 2021
d94f72c
Update dependencies and move to NPM v8 (#65)
psoleckimoj Dec 7, 2021
dccca36
Upgrading dependencies (#66)
andrewrlee Jan 6, 2022
a192197
Update modules and remove express-request-id (#67)
psoleckimoj Jan 25, 2022
2c530c0
INC-163 Timeout Fix - Correctly sets the timeout for a HttpAgent (#69)
Mjwillis Feb 4, 2022
59a9b65
⬆️ update dependencies and 💄add no-only-tests linting rule for cypres…
connormaglynn Feb 14, 2022
9651352
SDI-60: 🔨 Add global protect and petty france to allowlists (#71)
petergphillips Feb 14, 2022
10ccbe8
Update dependencies (#72)
psoleckimoj Mar 2, 2022
c450787
DCS-1442 jquery-ui.css coep fix (#73)
louisenorris Mar 8, 2022
7d9565b
Fixing docker caching issue (#74)
andrewrlee Mar 18, 2022
fd85c22
Setup prometheus metrics by default. (#75)
Mar 24, 2022
49c6ad6
Bump minimist from 1.2.5 to 1.2.6 (#76)
dependabot[bot] Mar 24, 2022
0354a09
Update dependencies (#77)
andrewrlee Apr 8, 2022
eefd2aa
Audit fix (#79)
andrewrlee Apr 11, 2022
dc3f727
NN-4060: App Insights only works with bunyan v1 (#80)
sp-watson Apr 20, 2022
e2e93b4
Update orb and dependencies (#82)
andrewrlee Apr 22, 2022
8aa16ee
Stop metrics test from hitting a real service and occasionally timing…
jonnywyatt Apr 22, 2022
752a0ec
SDI-181: 🔧 Add jira notifications for new projects (#83)
petergphillips Apr 28, 2022
05dcc72
Adding better redis error handling (#84)
andrewrlee May 3, 2022
3bd1861
SDI-181: 🔧 Use new cimg redis executor (#85)
petergphillips May 4, 2022
968735d
SLM-245 Restore cache prior to running up the app for the integration…
mikehalmamoj May 11, 2022
6676e3a
SDI-88: 🚨 Fix querystring warning (#87)
petergphillips May 12, 2022
0bd862a
SDI-88: 🐛 Fix cookie session down as a dependency (#88)
petergphillips May 13, 2022
73c1b62
SDI-88: ♻️ Tidy up mocks and switch to multiplatform builds (#89)
petergphillips May 13, 2022
0f2559b
Allow async get to take an array of strings for paths like original g…
psoleckimoj May 16, 2022
5e69d1a
SDI-182: ✨ Switch to using connection string instead (#91)
petergphillips May 16, 2022
5d61681
Update README.md (#92)
andrewrlee May 17, 2022
7a08151
SDI-88: ✅ Add token verification integration tests (#94)
petergphillips May 19, 2022
6de4fe3
Minor "code smell" fixes suggested by Sonar Cloud (#95)
ushkarev May 20, 2022
f4d9846
SDI-211: 🔒️ Bump versions to fix security issues and cope with passpo…
petergphillips May 24, 2022
d5d2fbc
Updating dependencies (#97)
andrewrlee May 26, 2022
d961034
SDI-211: 🎨 Enforce trailing comma on functions too (#98)
petergphillips May 30, 2022
992fff1
SDI-211: 🎨 Enforce arrow parens (#99)
petergphillips May 31, 2022
2fa5e70
Bump dependencies (#100)
psoleckimoj Jun 6, 2022
127b2c7
SDI-218: ⬆ Upgrade cypress to v10 (#101)
petergphillips Jun 8, 2022
5249392
⬆️ Update dependencies (#102)
connormaglynn Jun 20, 2022
3c43ed9
Ignore false positive around nodemon (#103)
andrewrlee Jun 23, 2022
3c5a9ba
Updating dependencies (#104)
andrewrlee Jul 5, 2022
616e7ce
Update dependencies (#105)
andrewrlee Jul 8, 2022
a6ac4cb
Create services container (#106)
andrewrlee Jul 8, 2022
a71978d
SDI-265: ♻️ Minor improvements (#107)
petergphillips Jul 11, 2022
9820452
SDI-265: 🚨 Add lint check for only (#108)
petergphillips Jul 12, 2022
d548f47
Update Jest to v28 and minor dependency updates (#109)
psoleckimoj Jul 21, 2022
1a9e219
Remove duplicate <main> elements (#110)
richpjames Jul 28, 2022
338690a
Bumping dependencies and fixing page width (#111)
andrewrlee Aug 11, 2022
26f0b62
Add a `cspNonce` to the webSecurity setup (#112)
pezholio Aug 15, 2022
e2299e3
Update dependencies 2022-08-22 (#113)
psoleckimoj Aug 22, 2022
3dfd162
Update dependencies to fix check outdated flagging typescript (#114)
neilmendum Aug 31, 2022
737b6f6
Update dependencies 2022-09-09 (#115)
psoleckimoj Sep 9, 2022
25b0208
Speeding up jest tests (#116)
andrewrlee Sep 12, 2022
610a227
Removing colour from logs in production mode (#117)
andrewrlee Sep 15, 2022
767c5d9
Move ingress (#118)
psoleckimoj Sep 20, 2022
9ca506c
SDI-345: ⬆️ Upgrade node and cypress (#119)
petergphillips Sep 21, 2022
0a16804
Fixing logging (#120)
andrewrlee Sep 23, 2022
af854b8
Update dependencies 2022-09-28 (#121)
psoleckimoj Sep 28, 2022
2dcae4f
⬆️Upgrade to latest helm chart versions (#122)
connormaglynn Oct 3, 2022
b2a656c
Adding badges (#123)
andrewrlee Oct 7, 2022
c78f1d5
Updating node to v18 (#124)
andrewrlee Oct 26, 2022
65980b1
Set helm timeout to 5 minutes (#125)
carlov20 Oct 27, 2022
f7aad6e
Use official redis image for docker-compose (#126)
neilmendum Nov 1, 2022
b7152f7
Update Helm config to match Kotlin template (#127)
neilmendum Nov 1, 2022
1d1ddb6
Update dependencies 2022-11-15 (#128)
psoleckimoj Nov 15, 2022
de90fee
Update dependencies 2022-11-16 (#129)
psoleckimoj Nov 16, 2022
317fcb2
Update node images (#130)
psoleckimoj Nov 25, 2022
6964e83
SDI-476: ⬆ Bump versions (#131)
petergphillips Dec 7, 2022
4920b06
Update dependencies 2022-12-08 (#132)
psoleckimoj Dec 8, 2022
8633cb0
Update dependencies 2022-12-19 (#133)
psoleckimoj Dec 19, 2022
2e1e3d5
Bump jsonwebtoken from 8.5.1 to 9.0.0 (#136)
dependabot[bot] Dec 23, 2022
3a127d6
Fix conflicting prettier / eslint rule (#135)
pezholio Dec 28, 2022
5386b50
SDI-523: 🔒️ Fix / ignoresecurity issues (#138)
petergphillips Jan 3, 2023
b636741
HEAT-41: use npm outdated job from HMPPS Orb; update other dependenci…
neilmendum Jan 17, 2023
839c8e1
Update dependencies 2023-01-24 (#140)
psoleckimoj Jan 24, 2023
4c975e6
Update dependencies 2023-01-31 (#141)
psoleckimoj Jan 31, 2023
9fc40b0
Update dependencies 2023-02-01 (#142)
psoleckimoj Feb 1, 2023
1f27375
Configure Renovate (#144)
renovate[bot] Feb 2, 2023
14cdec7
Update Helm release generic-service to v2.4.0 (#146)
renovate[bot] Feb 3, 2023
a99053c
Update peter-evans/create-pull-request action to v4 (#148)
renovate[bot] Feb 3, 2023
97b1fa8
Update actions/checkout action to v3 (#147)
renovate[bot] Feb 3, 2023
92b5a33
Add .nvmrc file, Prettier support for Nunjucks and use SCSS (#143)
davidmiddletonmoj Feb 3, 2023
7745886
Revert build_multiplatform_docker because it causes the build to take…
neilmendum Feb 3, 2023
b80efe8
Update dependency cypress to ^12.5.1 (#150)
renovate[bot] Feb 7, 2023
20f2181
HEAT-52: reduce the size of the PR body by specifying prBodyTemplate …
neilmendum Feb 13, 2023
0075fab
Update all non major NPM dependencies (#151)
renovate[bot] Feb 13, 2023
8e5a9d2
Update all non major NPM dependencies (#153)
renovate[bot] Feb 16, 2023
d9c2d14
Update all non major NPM dependencies (#155)
renovate[bot] Feb 24, 2023
941ca4d
Update all non major NPM dependencies (#156)
renovate[bot] Feb 28, 2023
cd997e0
Update all non major NPM dependencies (#159)
renovate[bot] Mar 2, 2023
41a6094
Update Helm release generic-service to v2.5.0 (#161)
renovate[bot] Mar 7, 2023
213008f
Update node image and regenerate package-lock.json (#165)
psoleckimoj Mar 16, 2023
154e107
Update hmpps-orb to v7.2.1 (#166)
garethmdavies Mar 16, 2023
220b506
Upgrade to connect-redis 7 and update other dependencies (#168)
psoleckimoj Mar 20, 2023
2b69d5b
Upgrade to typescript 5 (#169)
psoleckimoj Mar 20, 2023
19be08c
Add HMPPS Auth URL to form-action CSP string (#170)
bryangaledxw Mar 20, 2023
919ecdc
Update TypeScript etc 2023-04-03 (#174)
psoleckimoj Apr 4, 2023
52f8e99
Removing unnecessary build (#172)
andrewrlee Apr 4, 2023
37f8bc0
Update dependencies 2023-04-12 (#177)
psoleckimoj Apr 12, 2023
06ecd8d
SDIT-738: ⚡️ Cache static resources for 1 hour (#178)
petergphillips Apr 13, 2023
b3477b1
Update dependencies 2023-04-21 (#181)
psoleckimoj Apr 21, 2023
757c6ef
Fix security vuln 2023-04-25 (#183)
psoleckimoj Apr 25, 2023
4b75683
Update Helm release generic-service to v2.6.2 (#182)
renovate[bot] Apr 25, 2023
194c154
SDIT-760: 🔧 Upgrade redis to 7 (#186)
petergphillips Apr 27, 2023
c8869d0
Update Helm release generic-service to v2.6.3 (#184)
renovate[bot] May 2, 2023
ea3f137
Tie css cache to version of application (#188)
andrewrlee May 10, 2023
88c301f
Fix version not appearing in application insights (#190)
andrewrlee May 16, 2023
5b7903b
Update Helm release generic-prometheus-alerts to v1.3.2 (#189)
renovate[bot] May 19, 2023
586d966
Add PreProd and Prod helm config (#193)
neilmendum May 19, 2023
f6b3725
Update slack orb to v4.12.5 (#185)
renovate[bot] May 23, 2023
83be369
Update peter-evans/create-pull-request action to v5 (#175)
renovate[bot] May 23, 2023
58512df
Update all non major NPM dependencies (#176)
renovate[bot] Jun 6, 2023
4466ddc
Update Node.js to v18.16 (#191)
renovate[bot] Jun 6, 2023
087bc0e
Update dependencies 2023-06-07 (#196)
psoleckimoj Jun 7, 2023
ded60e6
Do not retry POST requests by default (#197)
andrewrlee Jun 9, 2023
ddf3823
Adding changelog (#198)
andrewrlee Jun 12, 2023
a5dc02d
Have `sanitisedError` always return an Error instance (#199)
ushkarev Jun 12, 2023
eac50e9
Update all non major NPM dependencies (#195)
renovate[bot] Jun 22, 2023
7e907e1
Update all non major NPM dependencies (#200)
renovate[bot] Jul 3, 2023
613628c
Fix semver vuln (#202)
psoleckimoj Jul 4, 2023
2c49560
Update govuk-frontend to 4.7.0 (#205)
psoleckimoj Jul 7, 2023
ee2b55a
Update all non major NPM dependencies (#204)
renovate[bot] Jul 27, 2023
b3e39ed
HEAT-82: Add productId and /info endpoint (#212)
psoleckimoj Aug 3, 2023
71d46bc
Update README with dev portal URL (#213)
psoleckimoj Aug 3, 2023
0ad7d20
Fix info endpoint test description (#214)
psoleckimoj Aug 3, 2023
ce05196
Update CHANGELOG.md (#216)
andrewrlee Aug 10, 2023
8b64d97
Fix linting, update modules, remove override (#219)
psoleckimoj Aug 16, 2023
fc402c2
Move /info to health check block (#220)
psoleckimoj Aug 18, 2023
dd2585c
Update dependencies 2023-09-05 (#226)
psoleckimoj Sep 5, 2023
dda7da0
Fix CircleCI workflows for cypress (#223)
ushkarev Sep 5, 2023
6e9a6f5
Fix cypress config and remove some vestigial code (#228)
ushkarev Sep 5, 2023
a357ce8
Update readme (#229)
psoleckimoj Sep 5, 2023
f2314e1
Update Helm release generic-prometheus-alerts to v1.3.3 (#224)
renovate[bot] Sep 6, 2023
ea81f5b
Update redis Docker tag to v7.2 (#221)
renovate[bot] Sep 6, 2023
8e536a6
Update Node.js to v18.18 (#230)
renovate[bot] Sep 21, 2023
a04c1e7
HEAT-106: Standardise endpoints (#231)
psoleckimoj Sep 22, 2023
57feb88
SDIT-1088: ✨ Get components to always return status even if failed (#…
petergphillips Sep 25, 2023
41227a8
SDIT-1108: 🔧 Don't default build args (#233)
petergphillips Sep 25, 2023
5251e36
SDIT-1108: ♻️ Fix deprecated syntax version of ENV (#234)
petergphillips Sep 25, 2023
9358419
SDIT-1108: ✨ Add in environment name to header (#235)
petergphillips Sep 28, 2023
b1a467a
SDIT-1108: 📝 Add new environment name to changelog (#236)
petergphillips Sep 29, 2023
1d8b294
NON-270: Improve REST client (#238)
ushkarev Oct 4, 2023
dc8cbc6
Update actions/checkout action to v4 (#225)
renovate[bot] Oct 4, 2023
7c9412a
Update all non major NPM dependencies (#210)
renovate[bot] Oct 4, 2023
7345c5a
Update Helm release generic-service to v2.6.5 (#237)
renovate[bot] Oct 4, 2023
9232bdf
Update dependencies 2023-10-17 (#243)
psoleckimoj Oct 17, 2023
8b4aa11
add tests for list base clients page
thomasridd Oct 20, 2023
96d49d6
add view base client page
thomasridd Oct 20, 2023
354bd37
Fix errors in template
thomasridd Oct 20, 2023
40b5679
basic view for create new base client screen
thomasridd Oct 23, 2023
8504faf
HAAR-1891: Update deprecated endpoints with new endpoints (#247)
ravmoj Oct 25, 2023
5807b1d
Update renovate.json (#248)
ushkarev Oct 25, 2023
bb7ea6e
post new base client with error loop
thomasridd Oct 26, 2023
5d231c6
added controller tests
thomasridd Oct 26, 2023
22cf418
add tests for presenter
thomasridd Oct 26, 2023
1936ebc
Merge branch 'main' into HAAR-1905-create-new-base-client-journey
thomasridd Oct 26, 2023
c541027
add test for expiry today
thomasridd Oct 26, 2023
5894228
Move to Node 20 plus minor updates (#249)
psoleckimoj Oct 27, 2023
c8dc656
Update CHANGELOG for node 20 change (#250)
psoleckimoj Oct 27, 2023
24fcc31
Update jwt-decode module to version 4.0.0 (#252)
psoleckimoj Oct 27, 2023
3eb9880
Update CHANGELOG.md (#253)
andrewrlee Oct 27, 2023
5948afa
correct test comments and refactor time functions
thomasridd Oct 27, 2023
5abb3c6
Added changelog for PR #247 (#254)
brightonsbox Oct 27, 2023
ff34146
display edit base clients details page
thomasridd Oct 27, 2023
61c1f47
Add post update functionality
thomasridd Oct 30, 2023
9202c93
Merge branch 'main' into HAAR-1906-edit-client-details-flow
thomasridd Oct 30, 2023
32fcdb6
update test comments
thomasridd Oct 31, 2023
410e01b
update comments
thomasridd Oct 31, 2023
da96f2c
display edit base clients deployment details page
thomasridd Oct 31, 2023
e25d9c9
add update deployment flow
thomasridd Oct 31, 2023
61b2af4
Merge remote-tracking branch 'template/main' into HAAR-2023-update-wi…
thomasridd Nov 1, 2023
74ce807
fix integration test
thomasridd Nov 1, 2023
ba5030a
Merge branch 'HAAR-2023-update-with-template-changes' into HAAR-1909-…
thomasridd Nov 2, 2023
54cf9fe
remove excess helm folder
thomasridd Nov 2, 2023
0f46e05
Merge branch 'main' into HAAR-1909-add-client-instance
thomasridd Nov 2, 2023
59fa874
add manage-users-api to docker-compose
thomasridd Nov 2, 2023
e0f01c7
add remove client instance code
thomasridd Nov 2, 2023
a74ccf1
page to display Delete Client confirmation
thomasridd Nov 3, 2023
afd2228
test update
thomasridd Nov 3, 2023
fb125f2
delete functionality - validation
thomasridd Nov 3, 2023
b0c75a2
add filter functionality
thomasridd Nov 7, 2023
fd2b075
setup homepage tests
thomasridd Nov 7, 2023
c6f99c1
base-client-list integration tests
thomasridd Nov 8, 2023
47f0f12
correct failing test
thomasridd Nov 8, 2023
4088e4a
remove template files
thomasridd Nov 8, 2023
ae76125
Merge branch 'main' into HAAR-2007-integration-testing
thomasridd Nov 8, 2023
fda9603
fix service filter
thomasridd Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/js/initMOJFilterPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ new MOJFrontend.FilterToggleButton({
container: $('.moj-action-bar__filter'),
showText: 'Show filter',
hideText: 'Hide filter',
classes: 'govuk-button--secondary',
classes: 'govuk-button--secondary toggle-filter-button',
attributes: {
'data-qa': 'toggle-filter-button',
},
},
closeButton: {
container: $('.moj-filter__header-action'),
Expand Down
88 changes: 88 additions & 0 deletions integration_tests/e2e/view-base-client-list.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import Page from '../pages/page'
import ViewBaseClientListPage from '../pages/viewBaseClientList'
import ViewBaseClientPage from '../pages/viewBaseClient'
import NewBaseClientGrantPage from '../pages/newBaseClientGrant'

const visitBaseClientListPage = (): ViewBaseClientListPage => {
cy.signIn()
cy.visit('/')
return Page.verifyOnPage(ViewBaseClientListPage)
}

context('Homepage - list base-clients', () => {
let listBaseClientsPage: ViewBaseClientListPage

beforeEach(() => {
cy.task('reset')
cy.task('stubSignIn')
cy.task('stubListBaseClients')
cy.task('stubGetBaseClient')
cy.task('stubManageUser')
cy.task('stubGetListClientInstancesList')

listBaseClientsPage = visitBaseClientListPage()
})

it('User can see base-client list', () => {
listBaseClientsPage.baseClientList().should('have.length', 3)
})

it('User can click through to base-client', () => {
listBaseClientsPage.baseClientList().first().children('a').click()
Page.verifyOnPage(ViewBaseClientPage)
})

it('User can see Add New button', () => {
listBaseClientsPage.addNewBaseClient().should('exist')
})

it('User can click through to new base-client page', () => {
listBaseClientsPage.addNewBaseClient().click()
Page.verifyOnPage(NewBaseClientGrantPage)
})

it('Filter page is hidden', () => {
listBaseClientsPage.filterPanel().should('not.be.visible')
})

it('Toggle filter button has text Show filter', () => {
listBaseClientsPage.toggleFilterButton().should('have.text', 'Show filter')
})

it('On click shows filter panel and updates text to Hide filter', () => {
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.filterPanel().should('be.visible')
listBaseClientsPage.toggleFilterButton().should('have.text', 'Hide filter')
})

it('On second click hides filter panel and reverts text to Show filter', () => {
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.filterPanel().should('not.be.visible')
listBaseClientsPage.toggleFilterButton().should('have.text', 'Show filter')
})

it('On second click hides filter panel and reverts text to Show filter', () => {
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.filterPanel().should('not.be.visible')
listBaseClientsPage.toggleFilterButton().should('have.text', 'Show filter')
})

it('On click Apply filter hides the filter', () => {
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.applyFilterButton().click()

listBaseClientsPage.filterPanel().should('not.be.visible')
})

it('On click Apply with filter content limits rows in table', () => {
listBaseClientsPage.toggleFilterButton().click()
listBaseClientsPage.roleFilterInputBox().type('ROLE_TWO')

listBaseClientsPage.applyFilterButton().click()

listBaseClientsPage.filterPanel().should('not.be.visible')
listBaseClientsPage.baseClientList().should('have.length', 2)
})
})
2 changes: 1 addition & 1 deletion integration_tests/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ declare namespace Cypress {
* Custom command to signIn. Set failOnStatusCode to false if you expect and non 200 return code
* @example cy.signIn({ failOnStatusCode: boolean })
*/
signIn(options?: { failOnStatusCode: boolean }): Chainable<AUTWindow>
signIn(options?: { failOnStatusCode: boolean; redirectPath?: string }): Chainable<AUTWindow>
}
}
19 changes: 18 additions & 1 deletion integration_tests/mockApis/baseClientsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { stubFor } from './wiremock'
import {
listBaseClientsResponseMock,
getBaseClientResponseMock,
getListClientInstancesResponseMock,
} from '../../server/data/localMockData/baseClientsResponseMock'

export default {
Expand All @@ -25,7 +26,7 @@ export default {
return stubFor({
request: {
method: 'GET',
urlPattern: `/baseClientsApi/base-clients/baseClientId`,
urlPattern: `/baseClientsApi/base-clients/base_client_id_1`,
},
response: {
status: 200,
Expand All @@ -36,4 +37,20 @@ export default {
},
})
},

stubGetListClientInstancesList: () => {
return stubFor({
request: {
method: 'GET',
urlPattern: `/baseClientsApi/base-clients/base_client_id_1/clients`,
},
response: {
status: 200,
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
jsonBody: getListClientInstancesResponseMock,
},
})
},
}
2 changes: 1 addition & 1 deletion integration_tests/mockApis/manageUsersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const stubUserRoles = () =>
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
jsonBody: [{ roleCode: 'SOME_USER_ROLE' }],
jsonBody: [{ roleCode: 'ROLE_CLIENT_CREDENTIALS' }],
},
})

Expand Down
7 changes: 7 additions & 0 deletions integration_tests/pages/newBaseClientGrant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page'

export default class NewBaseClientGrantPage extends Page {
constructor() {
super('Select a grant type')
}
}
7 changes: 7 additions & 0 deletions integration_tests/pages/viewBaseClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page'

export default class ViewBaseClientPage extends Page {
constructor() {
super('Client:')
}
}
19 changes: 19 additions & 0 deletions integration_tests/pages/viewBaseClientList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Page, { PageElement } from './page'

export default class ViewBaseClientListPage extends Page {
constructor() {
super('OAuth Client details')
}

public baseClientList = (): PageElement => cy.get('[data-qa=baseClientList]')

public addNewBaseClient = (): PageElement => cy.get('[data-qa=addNewBaseClientButton]')

public toggleFilterButton = (): PageElement => cy.get('.toggle-filter-button')

public applyFilterButton = (): PageElement => cy.get('.govuk-button').contains('Apply filters')

public filterPanel = (): PageElement => cy.get('.moj-filter')

public roleFilterInputBox = (): PageElement => cy.get('[data-qa=roleFilterInputBox]')
}
7 changes: 4 additions & 3 deletions integration_tests/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Cypress.Commands.add('signIn', (options = { failOnStatusCode: true }) => {
cy.request('/')
return cy.task('getSignInUrl').then((url: string) => cy.visit(url, options))
Cypress.Commands.add('signIn', (options = { failOnStatusCode: true, redirectPath: '/' }) => {
const { failOnStatusCode, redirectPath } = options
cy.request(redirectPath)
return cy.task('getSignInUrl').then((url: string) => cy.visit(url, { failOnStatusCode }))
})
28 changes: 26 additions & 2 deletions server/data/localMockData/baseClientsResponseMock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { GetBaseClientResponse, ListBaseClientsResponse } from '../../interfaces/baseClientApi/baseClientResponse'
import {
GetBaseClientResponse,
ListBaseClientsResponse,
ListClientInstancesResponse,
} from '../../interfaces/baseClientApi/baseClientResponse'

export const listBaseClientsResponseMock: ListBaseClientsResponse = {
clients: [
Expand All @@ -7,6 +11,7 @@ export const listBaseClientsResponseMock: ListBaseClientsResponse = {
clientType: 'SERVICE',
teamName: null,
grantType: 'client_credentials',
roles: 'ROLE_ONE, ROLE_TWO',
count: 1,
},
{
Expand All @@ -21,13 +26,14 @@ export const listBaseClientsResponseMock: ListBaseClientsResponse = {
clientType: 'SERVICE',
teamName: 'Team 2',
grantType: 'client_credentials',
roles: 'ROLE_TWO, ROLE_THREE',
count: 1,
},
],
}

export const getBaseClientResponseMock: GetBaseClientResponse = {
clientId: 'baseClientId1',
clientId: 'base_client_id_1',
scopes: ['read', 'write'],
authorities: ['ROLE_CLIENT_CREDENTIALS'],
ips: [],
Expand All @@ -48,3 +54,21 @@ export const getBaseClientResponseMock: GetBaseClientResponse = {
deploymentInfo: 'deployment deployment info',
},
}

export const getListClientInstancesResponseMock: ListClientInstancesResponse = {
clients: [
{
clientId: 'base_client_id_1_01',
created: '2020-01-01T00:00:00.000',
},
{
clientId: 'base_client_id_1_02',
created: '2020-01-01T00:00:00.000',
},
{
clientId: 'base_client_id_1_03',
created: '2020-01-01T00:00:00.000',
},
],
grantType: 'client_credentials',
}
8 changes: 7 additions & 1 deletion server/views/pages/base-clients.njk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
text: 'Role',
classes: 'govuk-label--m'
},
attributes: {
'data-qa': 'roleFilterInputBox'
},
value: presenter.filter.roleSearch
}) }}

Expand Down Expand Up @@ -127,7 +130,10 @@
items: [{
text: 'Add new client',
href:"/base-clients/new",
classes: 'govuk-button--primary'
classes: 'govuk-button--primary',
attributes: {
'data-qa': 'addNewBaseClientButton'
}
}]
}) }}
</div>
Expand Down
21 changes: 16 additions & 5 deletions server/views/presenters/listBaseClientsPresenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const indexTableRows = (data: BaseClient[], filter?: BaseClientListFilter) => {
return dataItems.map(item => [
{
html: `<a href='/base-clients/${item.baseClientId}'>${item.baseClientId}</a>`,
attributes: {
'data-qa': 'baseClientList',
},
},
{
html: item.count > 1 ? `<span class='moj-badge'>${item.count}</span>` : '',
Expand Down Expand Up @@ -116,21 +119,29 @@ export const filterBaseClient = (baseClient: BaseClient, filter: BaseClientListF
}
}

if (baseClient.grantType === 'client_credentials' && !filter.clientCredentials) {
const grantType = baseClient.grantType ? baseClient.grantType.trim().toLowerCase() : ''
const clientType = baseClient.clientType ? baseClient.clientType.trim().toLowerCase() : ''

if (grantType === 'client_credentials' && !filter.clientCredentials) {
return false
}

if (baseClient.grantType === 'authorisation_code' && !filter.authorisationCode) {
if (grantType === 'authorisation_code' && !filter.authorisationCode) {
return false
}

if (baseClient.clientType === 'PERSONAL' && !filter.personalClientType) {
if (clientType === 'personal' && !filter.personalClientType) {
return false
}
if (baseClient.clientType === 'SERVICE' && !filter.serviceClientType) {
if (clientType === 'service' && !filter.serviceClientType) {
return false
}
return filter.blankClientType

if (clientType === '' && !filter.blankClientType) {
return false
}

return true
}

export default (data: BaseClient[], filter?: BaseClientListFilter) => {
Expand Down
2 changes: 1 addition & 1 deletion server/views/presenters/viewBaseClientPresenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default (baseClient: BaseClient, clients: Client[]) => {
html: item.created.toLocaleDateString('en-GB'),
},
{
html: item.accessed.toLocaleDateString('en-GB'),
html: item.accessed ? item.accessed.toLocaleDateString('en-GB') : '',
},
{
html: `<a class="govuk-link" href="/base-clients/${baseClient.baseClientId}/clients/${item.clientId}/delete">delete</a>`,
Expand Down