signal-desktop/test/views/conversation_search_view_test.js
lilia 3d98b54027 Create contact from number with common punctuation
The 'Create new contact' option should now appear for numbers including
parens and other common punctuation.

// FREEBIE
2015-12-09 18:58:51 -08:00

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);
});
});
});