Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14504 from etiennesegonzac/bug-943716-flatfish-co…
Browse files Browse the repository at this point in the history
…ntact-bug

Bug 943716 - Don't try dialing from the contact app if if mozTelephony is unavailable. r=arcturus
  • Loading branch information
etiennesegonzac committed Dec 16, 2013
2 parents e87db7e + 030c626 commit 5705238
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion apps/communications/contacts/js/contacts.js
Expand Up @@ -412,7 +412,7 @@ var Contacts = (function() {
number: number
}
});
} else {
} else if (navigator.mozTelephony) {
TelephonyHelper.call(number);
}
});
Expand Down
32 changes: 11 additions & 21 deletions apps/communications/contacts/test/marionette/details_test.js
Expand Up @@ -13,31 +13,21 @@ marionette('Contacts > Details', function() {
selectors = Contacts.Selectors;
});

suite('Click phone number', function() {
test('Shows error /w no sim', function() {
var tel = 1231231234;
test('Display the phone number', function() {
var tel = 1231231234;

subject.addContact({
givenName: 'Hello',
tel: 1231231234
});

client.helper.waitForElement(selectors.listContactFirstText)
.click();

subject.waitSlideLeft('details');

client.helper.waitForElement(selectors.detailsTelButtonFirst)
.click();
subject.addContact({
givenName: 'Hello',
tel: tel
});

var header = client.helper.waitForElement(selectors.confirmHeader);
client.helper.waitForElement(selectors.listContactFirstText)
.click();

var expectedHeaderText = subject.l10n(
'/dialer/locales/shared.en-US.properties',
'emergencyDialogTitle');
subject.waitSlideLeft('details');

assert.equal(header.text(), expectedHeaderText);
});
var telNode = client.helper.waitForElement(selectors.detailsTelButtonFirst);
assert.equal(telNode.text(), tel);
});

});

0 comments on commit 5705238

Please sign in to comment.