Log out information from DOMException when import fails (#1923)
This should give us the information we're looking for when imports fail mysteriously! https://developer.mozilla.org/en-US/docs/Web/API/DOMException
This commit is contained in:
parent
8fd0adc486
commit
66aa76e501
2 changed files with 95 additions and 73 deletions
|
@ -1,6 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
describe('Backup', function() {
|
||||
describe('handleDOMException', function() {
|
||||
it('handles null, still calls reject', function() {
|
||||
var called = 0;
|
||||
var reject = function() {
|
||||
called += 1;
|
||||
};
|
||||
var error = null;
|
||||
var prefix = 'something';
|
||||
|
||||
Whisper.Backup.handleDOMException(prefix, error, reject);
|
||||
|
||||
assert.strictEqual(called, 1);
|
||||
});
|
||||
|
||||
it('handles object code and message', function() {
|
||||
var called = 0;
|
||||
var reject = function() {
|
||||
called += 1;
|
||||
};
|
||||
var error = {
|
||||
code: 4,
|
||||
message: 'some cryptic error',
|
||||
};
|
||||
var prefix = 'something';
|
||||
|
||||
Whisper.Backup.handleDOMException(prefix, error, reject);
|
||||
|
||||
assert.strictEqual(called, 1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('sanitizeFileName', function() {
|
||||
it('leaves a basic string alone', function() {
|
||||
var initial = 'Hello, how are you #5 (\'fine\' + great).jpg';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue