diff --git a/app/utils/date-helpers.js b/app/utils/date-helpers.js index c493e38..8d839c5 100644 --- a/app/utils/date-helpers.js +++ b/app/utils/date-helpers.js @@ -1,7 +1,3 @@ -function formatDate(date, format) { +export default function formatDate(date, format) { return window.moment(date).format(format); } - -export { - formatDate -}; diff --git a/app/utils/parse-base64.js b/app/utils/parse-base64.js index 5735e8f..eaf7f7b 100644 --- a/app/utils/parse-base64.js +++ b/app/utils/parse-base64.js @@ -4,6 +4,6 @@ export default function parseBase64(token) { tokenData = atob(token.split('.')[1]); return JSON.parse(tokenData); } catch (e) { - return tokenData; + return token; } } diff --git a/tests/unit/utils/parse-base64-test.js b/tests/unit/utils/parse-base64-test.js index c0387b4..ecdf56e 100644 --- a/tests/unit/utils/parse-base64-test.js +++ b/tests/unit/utils/parse-base64-test.js @@ -1,10 +1,10 @@ import parseBase64 from '../../../utils/parse-base64'; import { module, test } from 'qunit'; -module('Unit | Utility | parse base64'); +module('parseBase64'); // Replace this with your real tests. test('it works', function(assert) { - var result = parseBase64(); + var result = parseBase64('123'); assert.ok(result); });