Prettier + parenthesis change
This commit is contained in:
parent
c313241d62
commit
009f07df05
3 changed files with 15 additions and 16 deletions
|
|
@ -2,7 +2,7 @@ import { getBoolFromString } from "./boolean-helper";
|
||||||
|
|
||||||
describe("getBoolFromString", () => {
|
describe("getBoolFromString", () => {
|
||||||
describe("Happy paths", () => {
|
describe("Happy paths", () => {
|
||||||
test("\"true\" -> true", () => {
|
test('"true" -> true', () => {
|
||||||
const input = "true";
|
const input = "true";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -10,7 +10,7 @@ describe("getBoolFromString", () => {
|
||||||
expect(output).toBe(true);
|
expect(output).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("\"false\" -> false", () => {
|
test('"false" -> false', () => {
|
||||||
const input = "false";
|
const input = "false";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -18,7 +18,7 @@ describe("getBoolFromString", () => {
|
||||||
expect(output).toBe(false);
|
expect(output).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("\"other string\" -> false", () => {
|
test('"other string" -> false', () => {
|
||||||
const input = "some random value";
|
const input = "some random value";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -28,7 +28,7 @@ describe("getBoolFromString", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Capitalization", () => {
|
describe("Capitalization", () => {
|
||||||
test("\"TRUE\" -> true", () => {
|
test('"TRUE" -> true', () => {
|
||||||
const input = "TRUE";
|
const input = "TRUE";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -36,7 +36,7 @@ describe("getBoolFromString", () => {
|
||||||
expect(output).toBe(true);
|
expect(output).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("\"True\" -> true", () => {
|
test('"True" -> true', () => {
|
||||||
const input = "True";
|
const input = "True";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -44,7 +44,7 @@ describe("getBoolFromString", () => {
|
||||||
expect(output).toBe(true);
|
expect(output).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("\"FALSE\" -> false", () => {
|
test('"FALSE" -> false', () => {
|
||||||
const input = "FALSE";
|
const input = "FALSE";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -52,7 +52,7 @@ describe("getBoolFromString", () => {
|
||||||
expect(output).toBe(false);
|
expect(output).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("\"False\" -> false", () => {
|
test('"False" -> false', () => {
|
||||||
const input = "False";
|
const input = "False";
|
||||||
|
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
@ -70,7 +70,7 @@ describe("getBoolFromString", () => {
|
||||||
|
|
||||||
expect(output).toBe(true);
|
expect(output).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("false -> false", () => {
|
test("false -> false", () => {
|
||||||
const input = false;
|
const input = false;
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ describe("getBoolFromString", () => {
|
||||||
const output = getBoolFromString(input);
|
const output = getBoolFromString(input);
|
||||||
|
|
||||||
expect(output).toBe(false);
|
expect(output).toBe(false);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ export function getQuerystringParameter(key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if you add the fmgPage to the querystringobject before calling, then pass true for skipFmgPageName
|
// if you add the fmgPage to the querystringobject before calling, then pass true for skipFmgPageName
|
||||||
export function buildQuerystringObject(qso, skipFmgPageName=false) {
|
export function buildQuerystringObject(qso, skipFmgPageName = false) {
|
||||||
const queryString = window.location.search;
|
const queryString = window.location.search;
|
||||||
const urlParams = new URLSearchParams(queryString);
|
const urlParams = new URLSearchParams(queryString);
|
||||||
|
|
||||||
for (const [name, value] of urlParams) {
|
for (const [name, value] of urlParams) {
|
||||||
if (name.toLowerCase() === "fmgpage" && skipFmgPageName) {
|
if (name.toLowerCase() === "fmgpage" && skipFmgPageName) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -21,4 +21,4 @@ export function buildQuerystringObject(qso, skipFmgPageName=false) {
|
||||||
qso[name] = value;
|
qso[name] = value;
|
||||||
}
|
}
|
||||||
return qso;
|
return qso;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,8 @@ const routes = [
|
||||||
// clear part related state because heritage selected a new vehicle
|
// clear part related state because heritage selected a new vehicle
|
||||||
if (
|
if (
|
||||||
to.query.fmgPage === fmgPageValues.VEHICLE &&
|
to.query.fmgPage === fmgPageValues.VEHICLE &&
|
||||||
getBoolFromString(
|
getBoolFromString(getFunnelCookie()?.HasDelayedClaimRegistration) &&
|
||||||
getFunnelCookie()?.HasDelayedClaimRegistration && !fromReturnUser
|
!fromReturnUser
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
store.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
store.commit(storeMutations.RESET_GLASS_PARTS_STATE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue