pr360-questionnaire 2.3.0 → 2.3.1
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/build/questionnaire-test.js +28 -1
- package/dist/index.js +1 -1
- package/js/questionnaire.ts +1 -1
- package/package.json +1 -1
- package/test/questionnaire-test.ts +36 -0
|
@@ -17453,8 +17453,8 @@ meter::-webkit-meter-optimum-value {
|
|
|
17453
17453
|
<vimeo-video controls src=${this.currentStep.url} class="questionnaire--video"></vimeo-video>
|
|
17454
17454
|
${this.canSelfBook ? x`
|
|
17455
17455
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. Based on your results ${this.siteSource || "we"} would like to help you set up an initial call with a professional.</h4></div>
|
|
17456
|
-
<button class="button--link" type="button" href=${this.bookingUrl} target="_blank">Book Appointment</button>
|
|
17457
17456
|
<div data-test-id="site-phone-number"><h4>Or if you'd like to speak with ${this.siteSource || "us"}, </br> please feel free to</h4><a href="tel:${this.phoneNumber}"><h1>Call ${this.siteSource || "Us"}</h1></a></div>
|
|
17457
|
+
<a class="button button--primary" href=${this.bookingUrl} target="_blank">Book Appointment</a>
|
|
17458
17458
|
` : x`
|
|
17459
17459
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. ${this.siteSource || "We"} will be calling you within 24 hours with more information.</h4></div>
|
|
17460
17460
|
<div data-test-id="site-phone-number"><h4>If you'd like to speak with ${this.siteSource || "us"} sooner, </br> please feel free to</h4><a href="tel:${this.phoneNumber}"><h1>Call ${this.siteSource || "Us"}</h1></a></div>
|
|
@@ -32218,6 +32218,33 @@ ${inspect(response)}
|
|
|
32218
32218
|
await questionnaireElement.updateComplete;
|
|
32219
32219
|
f3(questionnaireElement.shadowRoot?.textContent).to.contain("Invalid verification code");
|
|
32220
32220
|
});
|
|
32221
|
+
it("renders Book Appointment as clickable link when canSelfBook is true", async () => {
|
|
32222
|
+
questionnaireElement.currentStep = {
|
|
32223
|
+
id: "video_123",
|
|
32224
|
+
type: "Video",
|
|
32225
|
+
text: "Based on your assessment, you are likely still losing too much blood.",
|
|
32226
|
+
url: "https://vimeo.com/123456"
|
|
32227
|
+
};
|
|
32228
|
+
questionnaireElement.canSelfBook = true;
|
|
32229
|
+
questionnaireElement.bookingUrl = "https://booking.example.com/appointment?prospect_id=abc123";
|
|
32230
|
+
questionnaireElement.phoneNumber = "555-123-4567";
|
|
32231
|
+
questionnaireElement.links = {
|
|
32232
|
+
contact_info_image: "/images/contact.jpg"
|
|
32233
|
+
};
|
|
32234
|
+
const button = questionnaireElement.querySelector("button");
|
|
32235
|
+
button?.click();
|
|
32236
|
+
await questionnaireElement.updateComplete;
|
|
32237
|
+
const bookingLink = questionnaireElement.shadowRoot?.querySelector('a[href="https://booking.example.com/appointment?prospect_id=abc123"]');
|
|
32238
|
+
f3(bookingLink).to.exist;
|
|
32239
|
+
f3(bookingLink?.textContent).to.contain("Book Appointment");
|
|
32240
|
+
f3(bookingLink?.getAttribute("target")).to.equal("_blank");
|
|
32241
|
+
f3(bookingLink?.classList.contains("button")).to.be.true;
|
|
32242
|
+
const infoDiv = questionnaireElement.shadowRoot?.querySelector('[data-test-id="questionnaire-info"]');
|
|
32243
|
+
f3(infoDiv).to.exist;
|
|
32244
|
+
f3(infoDiv?.textContent).to.contain("set up an initial call with a professional");
|
|
32245
|
+
const phoneDiv = questionnaireElement.shadowRoot?.querySelector('[data-test-id="site-phone-number"]');
|
|
32246
|
+
f3(phoneDiv).to.exist;
|
|
32247
|
+
});
|
|
32221
32248
|
});
|
|
32222
32249
|
})();
|
|
32223
32250
|
/*! Bundled license information:
|
package/dist/index.js
CHANGED
|
@@ -7642,8 +7642,8 @@ meter::-webkit-meter-optimum-value {
|
|
|
7642
7642
|
<vimeo-video controls src=${this.currentStep.url} class="questionnaire--video"></vimeo-video>
|
|
7643
7643
|
${this.canSelfBook ? x`
|
|
7644
7644
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. Based on your results ${this.siteSource || "we"} would like to help you set up an initial call with a professional.</h4></div>
|
|
7645
|
-
<button class="button--link" type="button" href=${this.bookingUrl} target="_blank">Book Appointment</button>
|
|
7646
7645
|
<div data-test-id="site-phone-number"><h4>Or if you'd like to speak with ${this.siteSource || "us"}, </br> please feel free to</h4><a href="tel:${this.phoneNumber}"><h1>Call ${this.siteSource || "Us"}</h1></a></div>
|
|
7646
|
+
<a class="button button--primary" href=${this.bookingUrl} target="_blank">Book Appointment</a>
|
|
7647
7647
|
` : x`
|
|
7648
7648
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. ${this.siteSource || "We"} will be calling you within 24 hours with more information.</h4></div>
|
|
7649
7649
|
<div data-test-id="site-phone-number"><h4>If you'd like to speak with ${this.siteSource || "us"} sooner, </br> please feel free to</h4><a href="tel:${this.phoneNumber}"><h1>Call ${this.siteSource || "Us"}</h1></a></div>
|
package/js/questionnaire.ts
CHANGED
|
@@ -243,8 +243,8 @@ export class QuestionnaireElement extends LitElement {
|
|
|
243
243
|
${this.canSelfBook ?
|
|
244
244
|
html`
|
|
245
245
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. Based on your results ${this.siteSource || 'we'} would like to help you set up an initial call with a professional.</h4></div>
|
|
246
|
-
<button class="button--link" type="button" href=${this.bookingUrl} target="_blank">Book Appointment</button>
|
|
247
246
|
<div data-test-id="site-phone-number"><h4>Or if you'd like to speak with ${this.siteSource || 'us'}, </br> please feel free to</h4><a href="tel:${this.phoneNumber}"><h1>Call ${this.siteSource || 'Us'}</h1></a></div>
|
|
247
|
+
<a class="button button--primary" href=${this.bookingUrl} target="_blank">Book Appointment</a>
|
|
248
248
|
` :
|
|
249
249
|
html`
|
|
250
250
|
<div data-test-id="questionnaire-info"><h4>Thank you for completing the assessment. ${this.siteSource || 'We'} will be calling you within 24 hours with more information.</h4></div>
|
package/package.json
CHANGED
|
@@ -131,4 +131,40 @@ describe('questionnaire test', async () => {
|
|
|
131
131
|
|
|
132
132
|
expect(questionnaireElement.shadowRoot?.textContent).to.contain("Invalid verification code");
|
|
133
133
|
});
|
|
134
|
+
|
|
135
|
+
it('renders Book Appointment as clickable link when canSelfBook is true', async () => {
|
|
136
|
+
questionnaireElement.currentStep = {
|
|
137
|
+
id: "video_123",
|
|
138
|
+
type: "Video",
|
|
139
|
+
text: "Based on your assessment, you are likely still losing too much blood.",
|
|
140
|
+
url: "https://vimeo.com/123456"
|
|
141
|
+
};
|
|
142
|
+
questionnaireElement.canSelfBook = true;
|
|
143
|
+
questionnaireElement.bookingUrl = "https://booking.example.com/appointment?prospect_id=abc123";
|
|
144
|
+
questionnaireElement.phoneNumber = "555-123-4567";
|
|
145
|
+
questionnaireElement.links = {
|
|
146
|
+
contact_info_image: '/images/contact.jpg'
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const button = questionnaireElement.querySelector('button');
|
|
150
|
+
button?.click();
|
|
151
|
+
await questionnaireElement.updateComplete;
|
|
152
|
+
|
|
153
|
+
// Book Appointment should be an anchor tag with the booking URL
|
|
154
|
+
const bookingLink = questionnaireElement.shadowRoot?.querySelector('a[href="https://booking.example.com/appointment?prospect_id=abc123"]');
|
|
155
|
+
expect(bookingLink).to.exist;
|
|
156
|
+
expect(bookingLink?.textContent).to.contain("Book Appointment");
|
|
157
|
+
expect(bookingLink?.getAttribute('target')).to.equal('_blank');
|
|
158
|
+
// Should have button styling
|
|
159
|
+
expect(bookingLink?.classList.contains('button')).to.be.true;
|
|
160
|
+
|
|
161
|
+
// The message about professional should appear
|
|
162
|
+
const infoDiv = questionnaireElement.shadowRoot?.querySelector('[data-test-id="questionnaire-info"]');
|
|
163
|
+
expect(infoDiv).to.exist;
|
|
164
|
+
expect(infoDiv?.textContent).to.contain("set up an initial call with a professional");
|
|
165
|
+
|
|
166
|
+
// Phone number section should also exist
|
|
167
|
+
const phoneDiv = questionnaireElement.shadowRoot?.querySelector('[data-test-id="site-phone-number"]');
|
|
168
|
+
expect(phoneDiv).to.exist;
|
|
169
|
+
});
|
|
134
170
|
});
|