make protractor tests work

This commit is contained in:
Andrew
2015-03-30 08:52:49 -06:00
parent bedbe8b489
commit df9ef592f5
13 changed files with 101 additions and 124 deletions

View File

@@ -28,10 +28,10 @@ export function defaults(dest) {
return dest;
}
export let isString = val => typeof val === 'string';
export let isFunction = val => typeof val === 'function';
export let isDefined = val => typeof val === 'undefined';
export let isObject = val => typeof val === 'object';
export let isString = val => typeof val === 'string'
export let isFunction = val => typeof val === 'function'
export let isDefined = val => typeof val === 'undefined'
export let isObject = val => typeof val === 'object'
export function pascalCaseToDashCase(str = '') {
return str.charAt(0).toLowerCase() + str.substring(1).replace(/[A-Z]/g, match => {
@@ -42,10 +42,10 @@ export function pascalCaseToDashCase(str = '') {
export let array = {
unique(array) {
return array.filter((value, index) => {
return array.indexOf(value) === index;
});
return array.indexOf(value) === index
})
}
};
}
export class Log {
static log(...args) {
@@ -64,3 +64,18 @@ export class Log {
console.error.apply(console, args)
}
}
export function readQueryParams() {
var queryParams = {}
const startIndex = window.location.href.indexOf('?')
if (startIndex !== -1) {
const queries = window.location.href.slice(startIndex + 1).split('&')
if (queries.length) {
queries.forEach((param) => {
var split = param.split('=')
queryParams[split[0]] = split[1]
})
}
}
return queryParams
}