From 8f1138dcad41006757bfb2e89e117ac0bf5b313d Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Thu, 21 Mar 2019 15:52:53 -0700 Subject: [PATCH] Chore: Unit test --- src/lib/viewers/__tests__/BaseViewer-test.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index 9a6b5e8ca..1ad42350b 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -241,13 +241,28 @@ describe('lib/viewers/BaseViewer', () => { sandbox.stub(base, 'emitMetric'); }); - it('should trigger an error if we have already retried', () => { + it('should trigger an error if we have already retried', () => { base.hasRetriedContentDownload = true; base.handleDownloadError('error', 'https://dl.boxcloud.com'); expect(base.triggerError).to.be.called; expect(base.load).to.not.be.called; }); + it('should trigger an error if the rep was deleted', () => { + base.hasRetriedContentDownload = false; + base.handleDownloadError( + { + details: { + isRepDeleted: true + } + }, + 'https://dl.boxcloud.com' + ); + + expect(base.triggerError).to.be.called; + expect(base.load).to.not.be.called; + }); + it('should retry load, and check download reachability if we are on a custom host', () => { base.hasRetriedContentDownload = false; DownloadReachability.isCustomDownloadHost.returns(false);