@flarehr/apollo-super-selection 5.12.47777 → 5.14.48686

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.
Files changed (47) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/p-9d066cda.entry.js +14 -0
  3. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  4. package/dist/lib/apollo-super-selection/p-e8140b03.system.entry.js +69 -0
  5. package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
  6. package/dist/lib/cjs/loader.cjs.js +1 -1
  7. package/dist/lib/cjs/{sss-button_41.cjs.entry.js → sss-button_43.cjs.entry.js} +82 -42
  8. package/dist/lib/collection/collection-manifest.json +4 -0
  9. package/dist/lib/collection/components/super-campaign/super-campaign.js +1 -1
  10. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +1 -1
  11. package/dist/lib/collection/components/super-selection-app/consent/consent-wrapper.js +32 -0
  12. package/dist/lib/collection/components/super-selection-app/consent/consent.js +3 -1
  13. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +2 -2
  14. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +2 -2
  15. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/member-name-input.js +18 -1
  16. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +4 -4
  17. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +2 -2
  18. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +32 -17
  19. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +2 -2
  20. package/dist/lib/collection/components/super-selection-app/misc/button.js +18 -1
  21. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +18 -1
  22. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +1 -1
  23. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +1 -1
  24. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +3 -3
  25. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +3 -3
  26. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +2 -2
  27. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +3 -3
  28. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +1 -1
  29. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page-wrapper.js +32 -0
  30. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +3 -1
  31. package/dist/lib/esm/apollo-super-selection.js +1 -1
  32. package/dist/lib/esm/loader.js +1 -1
  33. package/dist/lib/esm/{sss-button_41.entry.js → sss-button_43.entry.js} +81 -43
  34. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  35. package/dist/lib/esm-es5/loader.js +1 -1
  36. package/dist/lib/esm-es5/sss-button_43.entry.js +69 -0
  37. package/dist/lib/types/components/super-selection-app/consent/consent-wrapper.d.ts +5 -0
  38. package/dist/lib/types/components/super-selection-app/funds/custom-fund/member-name-input.d.ts +1 -0
  39. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +1 -2
  40. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +1 -0
  41. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +1 -0
  42. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page-wrapper.d.ts +5 -0
  43. package/dist/lib/types/components.d.ts +36 -0
  44. package/package.json +1 -1
  45. package/dist/lib/apollo-super-selection/p-53ef7969.entry.js +0 -14
  46. package/dist/lib/apollo-super-selection/p-b917605f.system.entry.js +0 -69
  47. package/dist/lib/esm-es5/sss-button_41.entry.js +0 -69
@@ -8,6 +8,7 @@
8
8
  "./components/app-host/super-selection-app-host.js",
9
9
  "./components/super-campaign/super-campaign.js",
10
10
  "./components/super-selection-app/app-state-pages/success.js",
11
+ "./components/super-selection-app/consent/consent-wrapper.js",
11
12
  "./components/super-selection-app/consent/consent.js",
12
13
  "./components/super-selection-app/existing-choice/existing-choice.js",
13
14
  "./components/super-selection-app/footer-section/footer-section.js",
@@ -34,6 +35,7 @@
34
35
  "./components/super-selection-app/prefill-fund/prefill-warning-box.js",
35
36
  "./components/super-selection-app/prefill-fund/prefill.js",
36
37
  "./components/super-selection-app/standard-choice/standard-choice-form.js",
38
+ "./components/super-selection-app/super-choice-page/super-choice-page-wrapper.js",
37
39
  "./components/super-selection-app/super-choice-page/super-choice-page.js",
38
40
  "./components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js",
39
41
  "./components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js"
@@ -69,6 +71,7 @@
69
71
  "components": [
70
72
  "sss-button",
71
73
  "sss-consent-page",
74
+ "sss-consent-page-wrapper",
72
75
  "sss-custom-fund",
73
76
  "sss-default-fund",
74
77
  "sss-dropdown-async",
@@ -102,6 +105,7 @@
102
105
  "sss-super-choice-item-bottom",
103
106
  "sss-super-choice-item-top",
104
107
  "sss-super-choice-page",
108
+ "sss-super-choice-page-wrapper",
105
109
  "stencil-route",
106
110
  "stencil-route-link",
107
111
  "stencil-route-switch",
@@ -156,7 +156,6 @@ export class SuperCampaignHost {
156
156
  this.handlePromotedFundJoined = (data) => {
157
157
  if (this.stringIsNullOrEmtpty(data.memberNumber) || this.stringIsNullOrEmtpty(data.usi)) {
158
158
  appInsightsService.trackErrorTrace('Super Campaign did not return (Promoted) memberNumber and/or usi');
159
- navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
160
159
  return;
161
160
  }
162
161
  const usi = Usi.clean(data.usi);
@@ -267,6 +266,7 @@ export class SuperCampaignHost {
267
266
  //TODO: Handle error
268
267
  // eslint-disable-next-line no-console
269
268
  console.error('Error loading component:', error);
269
+ appInsightsService.trackErrorTrace(`Error in loading Super Campaign: ${error}`);
270
270
  }
271
271
  }
272
272
  disconnectedCallback() {
@@ -26,7 +26,7 @@ export class Success {
26
26
  h("p", { class: "mt-4 text-center text-gray-600 leading-7 max-w-560 mx-auto" }, "Your superannuation details have been updated successfully and will be submitted to your employer."),
27
27
  h("div", { class: "flex justify-center mt-8" },
28
28
  h("div", { class: "max-w-[200px] w-full" },
29
- h("sss-button", { size: "xl", fillWidth: true, onClick: this.handleContinueButtonClick },
29
+ h("sss-button", { testid: "continue-button", size: "xl", fillWidth: true, onClick: this.handleContinueButtonClick },
30
30
  h("span", null, "Continue"))))));
31
31
  }
32
32
  handleContinueButtonClick(_event) {
@@ -0,0 +1,32 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ import { injectHistory } from '@stencil/router';
3
+ import superSelectionService from '../services/super-selection-app.service';
4
+ export class ConsentWrapper {
5
+ render() {
6
+ return superSelectionService.state.superCampaignEnabled ? (h("sss-super-campaign-host", null)) : (h("sss-consent-page", null));
7
+ }
8
+ static get is() { return "sss-consent-page-wrapper"; }
9
+ static get properties() { return {
10
+ "history": {
11
+ "type": "unknown",
12
+ "mutable": false,
13
+ "complexType": {
14
+ "original": "RouterHistory",
15
+ "resolved": "RouterHistory",
16
+ "references": {
17
+ "RouterHistory": {
18
+ "location": "import",
19
+ "path": "@stencil/router"
20
+ }
21
+ }
22
+ },
23
+ "required": false,
24
+ "optional": false,
25
+ "docs": {
26
+ "tags": [],
27
+ "text": ""
28
+ }
29
+ }
30
+ }; }
31
+ }
32
+ injectHistory(ConsentWrapper);
@@ -1,4 +1,5 @@
1
1
  import { Component, h, Prop, State } from '@stencil/core';
2
+ import { injectHistory } from '@stencil/router';
2
3
  import { isSome } from 'fp-ts/lib/Option';
3
4
  import { SuperFundDisclaimerViewedDetail } from '../api/super-selection-events.model';
4
5
  import promotedFundState from '../funds/promoted-fund/promoted-fund.store';
@@ -36,7 +37,7 @@ export class Consent {
36
37
  ' ',
37
38
  h(Link, { className: "font-medium text-blue-600 hover:text-blue-800", href: "https://www.flarehr.com/privacy-policy" }, "Privacy Policy"),
38
39
  ".")),
39
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleSuperFundDisclaimerAccepted() }, "Continue")))));
40
+ h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSuperFundDisclaimerAccepted() }, "Continue")))));
40
41
  }
41
42
  async handleSuperFundDisclaimerAccepted() {
42
43
  await this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync({
@@ -84,3 +85,4 @@ export class Consent {
84
85
  "campaignConnectRequestInProgress": {}
85
86
  }; }
86
87
  }
88
+ injectHistory(Consent);
@@ -80,7 +80,7 @@ export class ExistingChoice {
80
80
  };
81
81
  const ChooseAnotherFundView = () => {
82
82
  return this.existingFund.type == 'Defined Benefits Fund' ? null : (h("div", { class: "mt-4" },
83
- h("sss-button", { fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")));
83
+ h("sss-button", { testid: "choose-another-fund-button", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")));
84
84
  };
85
85
  return (h("div", null,
86
86
  h("div", { class: "text-2xl sm:text-3xl font-bold text-center" }, "Your super nomination"),
@@ -125,7 +125,7 @@ export class ExistingChoice {
125
125
  }
126
126
  })())),
127
127
  h("div", { class: "mt-6" },
128
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleFundNominationAccepted() }, "Continue with this fund"))),
128
+ h("sss-button", { testid: "continue-with-this-fund-button", fillWidth: true, promiseFn: () => this.handleFundNominationAccepted() }, "Continue with this fund"))),
129
129
  h(ChooseAnotherFundView, null)))));
130
130
  }
131
131
  async handleFundNominationAccepted() {
@@ -64,9 +64,9 @@ export class DefaultFund {
64
64
  h("div", { class: "flex justify-center mt-8" },
65
65
  h("div", { class: "sm:max-w-320 w-full" },
66
66
  this.isDefaultFundExists && !this.isInvalidDefaultFund && (h("div", { class: "mb-4" },
67
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm() }, "Continue"))),
67
+ h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm() }, "Continue"))),
68
68
  h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
69
- h("sss-button", { fillWidth: true, variant: "secondary" }, "Back"))))))));
69
+ h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back"))))))));
70
70
  }
71
71
  async handleSubmitForm() {
72
72
  if (this.isInvalidDefaultFund) {
@@ -11,7 +11,7 @@ export class MemberNameInput {
11
11
  }
12
12
  render() {
13
13
  return (h(Host, null,
14
- h("input", { type: "text", class: {
14
+ h("input", { "data-testid": this.testId, type: "text", class: {
15
15
  'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md': true,
16
16
  'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
17
17
  .showValidationErrors
@@ -50,6 +50,23 @@ export class MemberNameInput {
50
50
  }
51
51
  static get is() { return "sss-name-input"; }
52
52
  static get properties() { return {
53
+ "testId": {
54
+ "type": "string",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "string",
58
+ "resolved": "string",
59
+ "references": {}
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": ""
66
+ },
67
+ "attribute": "test-id",
68
+ "reflect": false
69
+ },
53
70
  "value": {
54
71
  "type": "string",
55
72
  "mutable": false,
@@ -35,7 +35,7 @@ export class MyOwnFundInputs {
35
35
  h("div", null,
36
36
  h("label", { class: "text-sm font-medium text-gray-700" }, "Fund name"),
37
37
  h("div", { class: "mt-1" },
38
- h("sss-dropdown-async", { searchFunction: this.searchFundsAsync, minSearchStringLength: this.MIN_SEARCH_STRING_LENGTH, required: true, requiredValidationMessage: "Select a fund", placeholder: `Type to search by name or USI...`, value: this.selectedOption, onValueChanged: (ev) => {
38
+ h("sss-dropdown-async", { testId: "fund-search-input", searchFunction: this.searchFundsAsync, minSearchStringLength: this.MIN_SEARCH_STRING_LENGTH, required: true, requiredValidationMessage: "Select a fund", placeholder: `Type to search by name or USI...`, value: this.selectedOption, onValueChanged: (ev) => {
39
39
  this.selectedOption = ev.detail;
40
40
  this.updateFund(ev.detail);
41
41
  }, showValidationErrors: this.showValidationErrors })),
@@ -45,7 +45,7 @@ export class MyOwnFundInputs {
45
45
  h("div", { class: "mt-3" },
46
46
  h("label", { class: "text-sm font-medium text-gray-700" }, "Member number"),
47
47
  h("div", { class: "mt-1" },
48
- h("input", { type: "text", class: {
48
+ h("input", { "data-testid": "member-number-input", type: "text", class: {
49
49
  'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md': true,
50
50
  'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
51
51
  .showValidationErrors
@@ -55,11 +55,11 @@ export class MyOwnFundInputs {
55
55
  h("div", { class: "mt-3 w-1/2" },
56
56
  h("label", { class: "text-sm font-medium text-gray-700" }, "Given name(s)"),
57
57
  h("div", { class: "mt-1" },
58
- h("sss-name-input", { name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFirstName), onChange: (ev) => this.updateMemberFirstName(ev.target.value.trim()) }))),
58
+ h("sss-name-input", { testId: "member-given-names-input", name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFirstName), onChange: (ev) => this.updateMemberFirstName(ev.target.value.trim()) }))),
59
59
  h("div", { class: "mt-3 w-1/2" },
60
60
  h("label", { class: "text-sm font-medium text-gray-700" }, "Last name"),
61
61
  h("div", { class: "mt-1" },
62
- h("sss-name-input", { name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFamilyName), onChange: (ev) => this.updateMemberFamilyName(ev.target.value.trim()) }))))));
62
+ h("sss-name-input", { testId: "member-last-name-input", name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: O.toUndefined(customFundState.myOwnFundForm.memberFamilyName), onChange: (ev) => this.updateMemberFamilyName(ev.target.value.trim()) }))))));
63
63
  }
64
64
  updateFund(fund) {
65
65
  this.formChanged.emit({ fundUsi: O.some(fund.value), fundName: O.some(fund.label) });
@@ -48,9 +48,9 @@ export class MyOwnFund {
48
48
  h("div", { class: "mb-4", onClick:
49
49
  // user clicks on disabled button (div wrapper) then validation errors will show
50
50
  () => (this.formState = 'validated') },
51
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
51
+ h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
52
52
  h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
53
- h("sss-button", { fillWidth: true, variant: "secondary" }, "Back")))))))));
53
+ h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back")))))))));
54
54
  }
55
55
  async handleSubmitForm() {
56
56
  this.formState = 'validated';
@@ -4,11 +4,16 @@ import customFundChoiceApi from '../api/custom-fund-choice.api';
4
4
  import customFundState from '../custom-fund.store';
5
5
  import { validateAbn } from './abn-validation';
6
6
  import bsbNumbers from './bankBsbNumbers';
7
+ var AbnValidationStatus;
8
+ (function (AbnValidationStatus) {
9
+ AbnValidationStatus[AbnValidationStatus["Invalid"] = 1] = "Invalid";
10
+ AbnValidationStatus[AbnValidationStatus["AbnIsUsedForRegulatedFund"] = 2] = "AbnIsUsedForRegulatedFund";
11
+ AbnValidationStatus[AbnValidationStatus["Valid"] = 3] = "Valid";
12
+ })(AbnValidationStatus || (AbnValidationStatus = {}));
7
13
  export class SelfManagedFundInputs {
8
14
  constructor() {
9
- this.isAbnValid = false;
15
+ this.abnValidationStatus = AbnValidationStatus.Invalid;
10
16
  this.isAbnTouched = false;
11
- this.isAbnUsedForRegulated = false;
12
17
  this.currentBank = none;
13
18
  this.addressErrorMessage = none;
14
19
  this.stateOptions = [
@@ -40,12 +45,21 @@ export class SelfManagedFundInputs {
40
45
  h("label", { class: "text-sm font-medium text-gray-700" }, "Fund ABN"),
41
46
  h("div", { class: "mt-1" },
42
47
  h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundAbn", id: "fundAbn", value: customFundState.selfManagedFundForm.fundAbn, inputmode: "numeric", pattern: "[0-9]*", onKeyUp: async (ev) => {
43
- const inputAbnValue = ev.target.value;
44
- this.updateFormField('fundAbn', inputAbnValue.trim());
45
- this.isAbnValid = validateAbn(inputAbnValue);
46
- if (this.isAbnValid)
47
- this.isAbnUsedForRegulated = await this.isAbnUsedForRegulatedAsync(inputAbnValue);
48
- this.updateFormField('isAbnValid', this.isAbnValid);
48
+ const abnInput = ev.target;
49
+ this.updateFormField('fundAbn', abnInput.value.trim());
50
+ this.abnValidationStatus = AbnValidationStatus.Invalid;
51
+ if (validateAbn(abnInput.value)) {
52
+ const isAbnUsedForRegulatedFund = await this.isAbnUsedForRegulatedAsync(abnInput.value);
53
+ this.abnValidationStatus = isAbnUsedForRegulatedFund
54
+ ? AbnValidationStatus.AbnIsUsedForRegulatedFund
55
+ : AbnValidationStatus.Valid;
56
+ }
57
+ // We need to set a custom validity message to trigger css invalid styles for non valid cases
58
+ const validityMessage = this.abnValidationStatus === AbnValidationStatus.Valid
59
+ ? ''
60
+ : 'Enter a valid fund ABN (digits only)';
61
+ abnInput.setCustomValidity(validityMessage);
62
+ this.updateFormField('isAbnValid', this.abnValidationStatus === AbnValidationStatus.Valid);
49
63
  }, onBlur: () => (this.isAbnTouched = true) }),
50
64
  this.renderAbnValidationError())),
51
65
  h("div", { class: "mt-3" },
@@ -83,11 +97,11 @@ export class SelfManagedFundInputs {
83
97
  h("div", { class: "mt-3 w-1/2" },
84
98
  h("label", { class: "text-sm font-medium text-gray-700" }, "Given name(s)"),
85
99
  h("div", { class: "mt-1" },
86
- h("sss-name-input", { name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFirstName, onChange: (ev) => this.updateFormField('memberFirstName', ev.target.value.trim()) }))),
100
+ h("sss-name-input", { testId: "member-given-names-input", name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFirstName, onChange: (ev) => this.updateFormField('memberFirstName', ev.target.value.trim()) }))),
87
101
  h("div", { class: "mt-3 w-1/2" },
88
102
  h("label", { class: "text-sm font-medium text-gray-700" }, "Last name"),
89
103
  h("div", { class: "mt-1" },
90
- h("sss-name-input", { name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFamilyName, onChange: (ev) => this.updateFormField('memberFamilyName', ev.target.value.trim()) })))),
104
+ h("sss-name-input", { testId: "member-last-name-input", name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFamilyName, onChange: (ev) => this.updateFormField('memberFamilyName', ev.target.value.trim()) })))),
91
105
  h("h3", { class: "text-lg font-bold mt-6" }, "Fund bank details"),
92
106
  h("div", { class: "mt-3" },
93
107
  h("label", { class: "text-sm font-medium text-gray-700" }, "Account name"),
@@ -116,11 +130,13 @@ export class SelfManagedFundInputs {
116
130
  }
117
131
  renderAbnValidationError() {
118
132
  if (this.isAbnTouched || this.showValidationErrors) {
119
- if (!this.isAbnValid) {
120
- return h("div", { class: "mt-2 text-sm text-red-600" }, "Enter a valid fund ABN (digits only)");
121
- }
122
- else if (this.isAbnUsedForRegulated) {
123
- return (h("div", { class: "mt-2 text-sm text-red-600" }, "The supplied ABN is for a regulated fund"));
133
+ switch (this.abnValidationStatus) {
134
+ case AbnValidationStatus.Invalid:
135
+ return h("div", { class: "mt-2 text-sm text-red-600" }, "Enter a valid fund ABN (digits only)");
136
+ case AbnValidationStatus.AbnIsUsedForRegulatedFund:
137
+ return (h("div", { class: "mt-2 text-sm text-red-600" }, "The supplied ABN is for a regulated fund"));
138
+ case AbnValidationStatus.Valid:
139
+ return [];
124
140
  }
125
141
  }
126
142
  return [];
@@ -206,9 +222,8 @@ export class SelfManagedFundInputs {
206
222
  }
207
223
  }; }
208
224
  static get states() { return {
209
- "isAbnValid": {},
225
+ "abnValidationStatus": {},
210
226
  "isAbnTouched": {},
211
- "isAbnUsedForRegulated": {},
212
227
  "currentBank": {},
213
228
  "addressErrorMessage": {}
214
229
  }; }
@@ -78,9 +78,9 @@ export class SelfManagedFund {
78
78
  h("div", { class: "mb-4", onClick:
79
79
  // user clicks on disabled button (div wrapper) then validation errors will show
80
80
  () => (this.formState = 'validated') },
81
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
81
+ h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
82
82
  h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
83
- h("sss-button", { fillWidth: true, variant: "secondary" }, "Back")))))))));
83
+ h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back")))))))));
84
84
  }
85
85
  updateIsSubmitDisabled() {
86
86
  this.isSubmitDisabled = !this.formElement.checkValidity() || !this.isAbnValid;
@@ -22,7 +22,7 @@ export class Button {
22
22
  base: 'px-4 py-2 text-base',
23
23
  xl: 'px-6 py-3 text-base'
24
24
  };
25
- return (h("button", { class: {
25
+ return (h("button", { "data-testid": this.testid, class: {
26
26
  [sizeCss[this.size]]: true,
27
27
  'inline-flex items-center justify-center border font-medium': true,
28
28
  'rounded-md shadow-sm focus:outline-none focus:ring-2': true,
@@ -53,6 +53,23 @@ export class Button {
53
53
  }
54
54
  static get is() { return "sss-button"; }
55
55
  static get properties() { return {
56
+ "testid": {
57
+ "type": "string",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "string",
61
+ "resolved": "string",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "testid",
71
+ "reflect": false
72
+ },
56
73
  "fillWidth": {
57
74
  "type": "boolean",
58
75
  "mutable": false,
@@ -148,7 +148,7 @@ export class SelectInputAsync {
148
148
  var _a;
149
149
  return (h(Host, null,
150
150
  h("div", { class: "relative" },
151
- h("input", { type: "text", class: {
151
+ h("input", { "data-testid": this.testId, type: "text", class: {
152
152
  'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md': true,
153
153
  'invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
154
154
  .showValidationErrors
@@ -176,6 +176,23 @@ export class SelectInputAsync {
176
176
  "$": ["dropdown-async.css"]
177
177
  }; }
178
178
  static get properties() { return {
179
+ "testId": {
180
+ "type": "string",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "string",
184
+ "resolved": "string",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": ""
192
+ },
193
+ "attribute": "test-id",
194
+ "reflect": false
195
+ },
179
196
  "placeholder": {
180
197
  "type": "string",
181
198
  "mutable": false,
@@ -61,7 +61,7 @@ export class PrefillInvalidMyOwnFund {
61
61
  h("sss-prefill-display-field", { field: this.memberLastName }),
62
62
  h("sss-prefill-display-field", { field: this.memberGivenNames })))),
63
63
  h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
64
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleChooseAnotherFund() }, "Choose another fund")))));
64
+ h("sss-button", { testid: "choose-another-fund-button", class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleChooseAnotherFund() }, "Choose another fund")))));
65
65
  }
66
66
  async handleChooseAnotherFund() {
67
67
  const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
@@ -60,7 +60,7 @@ export class PrefillInvalidSMSF {
60
60
  h("sss-prefill-display-field", { field: this.bankAccountBsb }),
61
61
  h("sss-prefill-display-field", { field: this.bankAccountNumber })))),
62
62
  h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
63
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
63
+ h("sss-button", { testid: "make-another-nomination-button", class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
64
64
  }
65
65
  initialiseComponent(prefill) {
66
66
  this.fundName = new SmsfFundName(prefill.fundName);
@@ -68,7 +68,7 @@ export class PrefillMyOwnFund {
68
68
  h("sss-prefill-display-field", { field: this.memberNumber }),
69
69
  h("sss-prefill-display-field", { field: this.memberLastName }),
70
70
  h("sss-prefill-display-field", { field: this.memberGivenNames }))),
71
- this.mode === 'review' && (h("sss-button", { class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
71
+ this.mode === 'review' && (h("sss-button", { testid: "edit-details-button", class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
72
72
  h("div", { class: "flex flex-row gap-2" },
73
73
  h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
74
74
  h("div", { class: "w-4 h-4 relative" },
@@ -101,8 +101,8 @@ export class PrefillMyOwnFund {
101
101
  } }),
102
102
  h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))))))),
103
103
  h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
104
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
105
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
104
+ h("sss-button", { testid: "continue-button", class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
105
+ h("sss-button", { testid: "choose-another-fund-button", class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
106
106
  }
107
107
  initialiseComponent(fundName, prefill) {
108
108
  this.fundUsi = new FundUsi(prefill.fundDetail.fundUsi, true);
@@ -81,7 +81,7 @@ export class PrefillSMSF {
81
81
  h("sss-prefill-display-field", { field: this.bankAccountBsb }),
82
82
  this.bankName.isValid && (h("sss-prefill-display-field", { field: this.bankName })),
83
83
  h("sss-prefill-display-field", { field: this.bankAccountNumber }))),
84
- this.mode === 'review' && (h("sss-button", { class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
84
+ this.mode === 'review' && (h("sss-button", { testid: "edit-details-button", class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
85
85
  h("div", { class: "flex flex-row gap-2" },
86
86
  h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
87
87
  h("div", { class: "w-4 h-4 relative" },
@@ -175,8 +175,8 @@ export class PrefillSMSF {
175
175
  } }),
176
176
  h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.bankAccountNumber.errorMessage))))))),
177
177
  h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
178
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
179
- h("sss-button", { class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
178
+ h("sss-button", { testid: "continue-button", class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
179
+ h("sss-button", { testid: "make-another-nomination-button", class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
180
180
  }
181
181
  isFormValid() {
182
182
  return (this.fundName.isValid &&
@@ -20,10 +20,10 @@ export var SuperSelectionAppRoutes;
20
20
  SuperSelectionAppRoutes["Success"] = "/success/";
21
21
  })(SuperSelectionAppRoutes || (SuperSelectionAppRoutes = {}));
22
22
  export const superSelectionAppStencilRoutes = [
23
- h("stencil-route", { url: SuperSelectionAppRoutes.ConsentPage, component: "sss-consent-page" }),
23
+ h("stencil-route", { url: SuperSelectionAppRoutes.ConsentPage, component: "sss-consent-page-wrapper" }),
24
24
  h("stencil-route", { url: SuperSelectionAppRoutes.ExistingChoicePage, component: "sss-existing-choice-page" }),
25
25
  h("stencil-route", { url: SuperSelectionAppRoutes.SuperCampaign, component: "sss-super-campaign-host" }),
26
- h("stencil-route", { exact: true, url: SuperSelectionAppRoutes.ChoicePage, component: "sss-super-choice-page" }),
26
+ h("stencil-route", { exact: true, url: SuperSelectionAppRoutes.ChoicePage, component: "sss-super-choice-page-wrapper" }),
27
27
  h("stencil-route", { url: SuperSelectionAppRoutes.SlateJoin, component: "sss-slate-join-page" }),
28
28
  h("stencil-route", { url: SuperSelectionAppRoutes.PromotedFundJoinV1, component: "sss-promoted-fund-join-v1-page" }),
29
29
  h("stencil-route", { url: SuperSelectionAppRoutes.PromotedFundJoinV2, component: "sss-promoted-fund-join-v2-page" }),
@@ -35,7 +35,7 @@ export class StandardChoiceFormInputDefaultFund {
35
35
  h("div", { class: "text-xs font-semibold text-gray-500 uppercase" }, "Nominated fund"),
36
36
  h("div", { class: "text-sm mt-2" }, standardChoiceFormState.fundName)),
37
37
  h("div", { class: "grid content-center ml-4" },
38
- h("sss-button", { size: "xs", variant: "secondary", promiseFn: async () => {
38
+ h("sss-button", { testid: "change-fund-button", size: "xs", variant: "secondary", promiseFn: async () => {
39
39
  await this.trackChangeRequestedAsync();
40
40
  const changeFundRoute = isSome(superSelectionAppService.state.superChoicePrefill)
41
41
  ? SuperSelectionAppRoutes.ConsentPage
@@ -55,13 +55,13 @@ export class StandardChoiceFormInputDefaultFund {
55
55
  'was-validated': this.formState === 'validated'
56
56
  }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = !this.formElement.checkValidity()) },
57
57
  h("label", { class: "text-sm font-medium text-gray-700" }, "Type your full name"),
58
- h("input", { type: "text", autocomplete: "off", class: {
58
+ h("input", { "data-testid": "standard-choice-form-signature-input", type: "text", autocomplete: "off", class: {
59
59
  'shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full text-base sm:text-sm border-gray-300 rounded-md mt-1': true,
60
60
  'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this.formState === 'validated'
61
61
  }, required: true, minlength: "2", name: "standardChoiceFormSignature", id: "standardChoiceFormSignature", value: this.standardChoiceFormSignature, onInput: (event) => (this.standardChoiceFormSignature = event.target.value) }),
62
62
  h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Type your full name"),
63
63
  h("div", { class: "mt-6" },
64
- h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Confirm and continue"))))))));
64
+ h("sss-button", { testid: "confirm-and-continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Confirm and continue"))))))));
65
65
  }
66
66
  renderLogo() {
67
67
  if (standardChoiceFormState.promotedFundId == undefined)
@@ -5,7 +5,7 @@ export class SuperChoiceItemBottom {
5
5
  h("div", { class: "py-6 px-4 flex flex-col justify-between h-full" },
6
6
  h("div", null,
7
7
  h("div", { class: { 'md:max-w-[240px]': true, 'lg:max-w-full': this.isMultiFund } },
8
- h("sss-button", { class: "uuid-button-continue", fillWidth: true, onClick: () => this.handleFundClick() }, "Choose this fund")),
8
+ h("sss-button", { testid: "choose-this-fund-button", class: "uuid-button-continue", fillWidth: true, onClick: () => this.handleFundClick() }, "Choose this fund")),
9
9
  h("div", { class: "text-xs text-gray-500 mt-6 leading-4" }, this.disclaimer)),
10
10
  this.abnInfo && this.abn && (h("div", { class: "text-xs text-gray-500 mt-2" },
11
11
  h("p", null,
@@ -0,0 +1,32 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ import { injectHistory } from '@stencil/router';
3
+ import superSelectionService from '../services/super-selection-app.service';
4
+ export class SuperChoicePageWrapper {
5
+ render() {
6
+ return superSelectionService.state.superCampaignEnabled ? (h("sss-super-campaign-host", null)) : (h("sss-super-choice-page", null));
7
+ }
8
+ static get is() { return "sss-super-choice-page-wrapper"; }
9
+ static get properties() { return {
10
+ "history": {
11
+ "type": "unknown",
12
+ "mutable": false,
13
+ "complexType": {
14
+ "original": "RouterHistory",
15
+ "resolved": "RouterHistory",
16
+ "references": {
17
+ "RouterHistory": {
18
+ "location": "import",
19
+ "path": "@stencil/router"
20
+ }
21
+ }
22
+ },
23
+ "required": false,
24
+ "optional": false,
25
+ "docs": {
26
+ "tags": [],
27
+ "text": ""
28
+ }
29
+ }
30
+ }; }
31
+ }
32
+ injectHistory(SuperChoicePageWrapper);
@@ -1,4 +1,5 @@
1
1
  import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
2
+ import { injectHistory } from '@stencil/router';
2
3
  import * as O from 'fp-ts/lib/Option';
3
4
  import * as constants from '../funds/constants';
4
5
  import promotedFundState from '../funds/promoted-fund/promoted-fund.store';
@@ -82,7 +83,7 @@ export class SuperChoicePage {
82
83
  ' ',
83
84
  h("a", { class: "text-primary-base font-medium hover:text-primary-hover", target: "_blank", href: navigationService.toExternalUrl(superfundsLink) }, superfundsLinkDisplay))),
84
85
  h("stencil-route-link", { url: SuperSelectionAppRoutes.MyOwnFund },
85
- h("sss-button", { fillWidthOnMobile: true }, "Choose another super fund")))),
86
+ h("sss-button", { testid: "choose-another-super-fund-button", fillWidthOnMobile: true }, "Choose another super fund")))),
86
87
  h("div", { class: "flex justify-center" },
87
88
  h("div", { class: "pt-8 sm:pt-12 max-w-720" },
88
89
  h("h5", { class: "font-semibold" }, "IMPORTANT INFORMATION:"),
@@ -171,3 +172,4 @@ export class SuperChoicePage {
171
172
  "promotedFunds": {}
172
173
  }; }
173
174
  }
175
+ injectHistory(SuperChoicePage);