3d98b54027
The 'Create new contact' option should now appear for numbers including parens and other common punctuation. // FREEBIE
24 lines
638 B
JavaScript
24 lines
638 B
JavaScript
describe('ConversationSearchView', function() {
|
|
it('should match partial numbers', function() {
|
|
var $el = $('<div><div class="new-contact contact hide"></div></div>');
|
|
var view = new Whisper.ConversationSearchView({el: $el, input: $('<input>')}).render();
|
|
var maybe_numbers = [
|
|
"+1 415",
|
|
"+1415",
|
|
"+1415",
|
|
"415",
|
|
"(415)",
|
|
" (415",
|
|
"(415) 123 4567",
|
|
"+1 (415) 123 4567",
|
|
" +1 (415) 123 4567",
|
|
"1 (415) 123 4567",
|
|
"1 415-123-4567",
|
|
"415-123-4567"
|
|
];
|
|
maybe_numbers.forEach(function(n) {
|
|
assert.ok(view.maybeNumber(n), n);
|
|
});
|
|
});
|
|
|
|
});
|