From fb4630207d86d39ea05dd679b2724be87597c518 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Thu, 23 Feb 2017 17:50:56 -0300 Subject: [#907] Moves i18n and util files to common directory with @thaissiqueira --- web-ui/test/unit/common/util.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 web-ui/test/unit/common/util.spec.js (limited to 'web-ui/test/unit/common/util.spec.js') diff --git a/web-ui/test/unit/common/util.spec.js b/web-ui/test/unit/common/util.spec.js new file mode 100644 index 00000000..805d9dd5 --- /dev/null +++ b/web-ui/test/unit/common/util.spec.js @@ -0,0 +1,20 @@ +import expect from 'expect'; +import Util from 'src/common/util'; + +describe('Utils', () => { + describe('.hasQueryParameter', () => { + global.window = { + location: { + search: '?auth-error&lng=pt-BR' + } + }; + + it('checks if param included in query parameters', () => { + expect(Util.hasQueryParameter('auth-error')).toBe(true); + }); + + it('checks if param not included in query parameters', () => { + expect(Util.hasQueryParameter('error')).toBe(false); + }); + }); +}); -- cgit v1.2.3