@defra-fish/gafl-webapp-service 1.65.0 → 1.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/gafl-webapp-service",
3
- "version": "1.65.0",
3
+ "version": "1.66.0",
4
4
  "description": "The websales frontend for the GAFL service",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,8 +36,8 @@
36
36
  "prepare": "gulp --gulpfile build/gulpfile.cjs"
37
37
  },
38
38
  "dependencies": {
39
- "@defra-fish/business-rules-lib": "1.65.0",
40
- "@defra-fish/connectors-lib": "1.65.0",
39
+ "@defra-fish/business-rules-lib": "1.66.0",
40
+ "@defra-fish/connectors-lib": "1.66.0",
41
41
  "@defra/hapi-gapi": "2.0.0",
42
42
  "@hapi/boom": "9.1.2",
43
43
  "@hapi/catbox-redis": "6.0.2",
@@ -79,5 +79,5 @@
79
79
  "./gafl-jest-matchers.js"
80
80
  ]
81
81
  },
82
- "gitHead": "cbc8e480972e58d71dc160f85f9d1f1e1e9debf2"
82
+ "gitHead": "421a4618fa978655c56c61e75b5de69c0420e756"
83
83
  }
@@ -47,9 +47,10 @@ describe('The licence-for page', () => {
47
47
  expect(n.backLink({ fromSummary: LICENCE_SUMMARY_SEEN })).toBe(LICENCE_SUMMARY.uri)
48
48
  })
49
49
 
50
- it('has a back-link to the journey-goal page in telesales journey', () => {
50
+ it('has a back-link to the journey-goal page in telesales journey when cancellation enabled', () => {
51
51
  jest.isolateModules(() => {
52
52
  process.env.CHANNEL = 'telesales'
53
+ process.env.SHOW_CANCELLATION_JOURNEY = 'true'
53
54
  const isolatedJourneyDefinition = require('../journey-definition.js').default
54
55
  const isolatedJourneyGoal = isolatedJourneyDefinition.find(n => n.current.page === LICENCE_FOR.page)
55
56
  expect(isolatedJourneyGoal.backLink({})).toBe(JOURNEY_GOAL.uri)
@@ -57,6 +58,22 @@ describe('The licence-for page', () => {
57
58
  })
58
59
  })
59
60
 
61
+ it.each([
62
+ ['telesales not flagged', 'CHANNEL', 'not_telesales'],
63
+ ['cancellation journey disabled', 'SHOW_CANCELLATION_JOURNEY', 'false'],
64
+ ['cancellation journey flag undefined', 'SHOW_CANCELLATION_JOURNEY', undefined]
65
+ ])('omits back-link to the journey-goal page if %s', (_d, envKey, envVal) => {
66
+ jest.isolateModules(() => {
67
+ process.env.CHANNEL = 'telesales'
68
+ process.env.SHOW_CANCELLATION_JOURNEY = 'true'
69
+ process.env[envKey] = envVal
70
+ const isolatedJourneyDefinition = require('../journey-definition.js').default
71
+ const isolatedJourneyGoal = isolatedJourneyDefinition.find(n => n.current.page === LICENCE_FOR.page)
72
+ expect(isolatedJourneyGoal.backLink({})).toBeNull()
73
+ delete process.env.CHANNEL
74
+ })
75
+ })
76
+
60
77
  it('has a back-link to the licence summary in telesales journey if the summary is seen', () => {
61
78
  jest.isolateModules(() => {
62
79
  process.env.CHANNEL = 'telesales'
@@ -113,7 +113,7 @@ export default [
113
113
  if (s.fromSummary) {
114
114
  return LICENCE_SUMMARY.uri
115
115
  }
116
- if (process.env.CHANNEL === 'telesales') {
116
+ if (process.env.CHANNEL === 'telesales' && process.env.SHOW_CANCELLATION_JOURNEY === 'true') {
117
117
  return JOURNEY_GOAL.uri
118
118
  }
119
119
  return null