Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix(contextToken): Empty or filled contextToken in tests setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rmakara committed Oct 18, 2019
1 parent 72f82c5 commit 749ed99
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { apiService } from "../../../src/apiService";
import { setCurrentCurrency, config } from "@shopware-pwa/shopware-6-client";
import {
setCurrentCurrency,
config,
update
} from "@shopware-pwa/shopware-6-client";

jest.mock("../../../src/apiService");
const mockedAxios = apiService as jest.Mocked<typeof apiService>;

describe("ContextService - setCurrentCurrency with contextToken given", () => {
beforeEach(() => {
update({ contextToken: "NWDdcRTTWoPk4Ngv13z5NDMMsDFRb9W6" });
jest.resetAllMocks();
});

Expand All @@ -30,6 +35,7 @@ describe("ContextService - setCurrentCurrency with contextToken given", () => {

describe("ContextService - setCurrentCurrency without contextToken given", () => {
beforeEach(() => {
update({ contextToken: undefined });
jest.resetAllMocks();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { apiService } from "../../../src/apiService";
import { setCurrentLanguage, config } from "@shopware-pwa/shopware-6-client";
import {
setCurrentLanguage,
config,
update
} from "@shopware-pwa/shopware-6-client";

jest.mock("../../../src/apiService");
const mockedAxios = apiService as jest.Mocked<typeof apiService>;

describe("ContextService - setCurrentLanguage with contextToken given", () => {
beforeEach(() => {
update({ contextToken: "NWDdcRTTWoPk4Ngv13z5NDMMsDFRb9W6" });
jest.resetAllMocks();
});

Expand All @@ -30,6 +35,7 @@ describe("ContextService - setCurrentLanguage with contextToken given", () => {

describe("ContextService - setCurrentLanguage without contextToken given", () => {
beforeEach(() => {
update({ contextToken: undefined });
jest.resetAllMocks();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { apiService } from "../../../src/apiService";
import {
setCurrentPaymentMethod,
config
config,
update
} from "@shopware-pwa/shopware-6-client";

jest.mock("../../../src/apiService");
const mockedAxios = apiService as jest.Mocked<typeof apiService>;

describe("ContextService - setCurrentPaymentMethod with contextToken given", () => {
beforeEach(() => {
update({ contextToken: "NWDdcRTTWoPk4Ngv13z5NDMMsDFRb9W6" });
jest.resetAllMocks();
});

Expand All @@ -33,6 +35,7 @@ describe("ContextService - setCurrentPaymentMethod with contextToken given", ()

describe("ContextService - setCurrentPaymentMethod without contextToken given", () => {
beforeEach(() => {
update({ contextToken: undefined });
jest.resetAllMocks();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { apiService } from "../../../src/apiService";
import {
setCurrentShippingMethod,
config
config,
update
} from "@shopware-pwa/shopware-6-client";

jest.mock("../../../src/apiService");
const mockedAxios = apiService as jest.Mocked<typeof apiService>;

describe("ContextService - setCurrentShippingMethod with contextToken given", () => {
beforeEach(() => {
update({ contextToken: "NWDdcRTTWoPk4Ngv13z5NDMMsDFRb9W6" });
jest.resetAllMocks();
});

Expand All @@ -33,6 +35,7 @@ describe("ContextService - setCurrentShippingMethod with contextToken given", ()

describe("ContextService - setCurrentShippingMethod without contextToken given", () => {
beforeEach(() => {
update({ contextToken: undefined });
jest.resetAllMocks();
});

Expand Down

0 comments on commit 749ed99

Please sign in to comment.