summaryrefslogtreecommitdiff
path: root/web-ui/test/unit/common/util.spec.js
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-02-23 17:50:56 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-02-23 17:50:56 -0300
commitfb4630207d86d39ea05dd679b2724be87597c518 (patch)
tree0573b4e7c18c88742a6cbecfceba009c3dbb4c34 /web-ui/test/unit/common/util.spec.js
parentde14bb0376d5b0ed511e52251a7c0e6cc38c39eb (diff)
[#907] Moves i18n and util files to common directory
with @thaissiqueira
Diffstat (limited to 'web-ui/test/unit/common/util.spec.js')
-rw-r--r--web-ui/test/unit/common/util.spec.js20
1 files changed, 20 insertions, 0 deletions
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);
+ });
+ });
+});