From f0b0d5580b1a4439d1e74188eb38158f82cd6bfd Mon Sep 17 00:00:00 2001 From: Conrad Chan Date: Fri, 30 Aug 2019 11:24:43 -0700 Subject: [PATCH] chore: fix CSVViewer tests --- src/lib/viewers/text/CSVViewer.js | 2 +- src/lib/viewers/text/__tests__/CSVViewer-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/viewers/text/CSVViewer.js b/src/lib/viewers/text/CSVViewer.js index 1f91eab7e..f67b7aed2 100644 --- a/src/lib/viewers/text/CSVViewer.js +++ b/src/lib/viewers/text/CSVViewer.js @@ -95,7 +95,7 @@ class CSVViewer extends TextBaseViewer { * @param {Array} results.errors Papaparse results errors array * @return {void} */ - checkForParseErrors({ errors = [] }) { + checkForParseErrors({ errors = [] } = {}) { if (!errors.length) { return; } diff --git a/src/lib/viewers/text/__tests__/CSVViewer-test.js b/src/lib/viewers/text/__tests__/CSVViewer-test.js index ce56d0281..27914b54b 100644 --- a/src/lib/viewers/text/__tests__/CSVViewer-test.js +++ b/src/lib/viewers/text/__tests__/CSVViewer-test.js @@ -218,7 +218,7 @@ describe('lib/viewers/text/CSVViewer', () => { it('should trigger error with a parse error', () => { stubs.getWorstParseError.returns({ foo: 'bar' }); - csv.checkForParseErrors([{ foo: 'bar' }]); + csv.checkForParseErrors({ errors: [{ foo: 'bar' }] }); expect(stubs.triggerError).to.be.called; });