Skip to content

Commit f78acbb

Browse files
authored
Merge pull request #1590 from RoundingWell/dialer-null-phone
In dialer service, handle `null`/`undefined` phone numbers in `showPatientLinks()`
2 parents 0fee527 + 5ead43d commit f78acbb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/js/services/dialer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export default App.extend({
4848
return;
4949
}
5050

51+
if (!number) return;
52+
5153
const phone = parsePhoneNumber(number, 'US');
5254

5355
if (phone && phone.isValid()) {

test/integration/services/dialer.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ context('Dialer Service', function() {
162162
.get('@patientButtons')
163163
.should('have.length', 1);
164164

165+
cy
166+
.getRadio(Radio => {
167+
Radio.request('dialer', 'showPatientLinks', {
168+
actionId: null,
169+
number: null,
170+
});
171+
});
172+
173+
cy
174+
.get('@patientButtons')
175+
.should('have.length', 1);
176+
165177
cy
166178
.getRadio(Radio => {
167179
Radio.request('dialer', 'showPatientLinks', null);
@@ -185,7 +197,7 @@ context('Dialer Service', function() {
185197
.getRadio(Radio => {
186198
Radio.request('dialer', 'showPatientLinks', {
187199
actionId: null,
188-
number: '+16513216543 ',
200+
number: '+16513216543',
189201
});
190202
});
191203

0 commit comments

Comments
 (0)