-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
87 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { describe, test } from "@jest/globals"; | ||
// import { MigrosAPI } from "../src"; | ||
import { describe, test, expect } from "@jest/globals"; | ||
import { MigrosAPI } from "../src"; | ||
import * as dotenv from "dotenv"; | ||
import path from "path"; | ||
|
||
describe("Check for Migros Cumulus Receipt", () => { | ||
test("Retrieve Cumulus Receipt", async () => { | ||
// const responseReceipts = await MigrosAPI.account.cumulus.getCumulusReceipts( | ||
// { | ||
// from: new Date("01.12.2023"), | ||
// to: new Date(), | ||
// }, | ||
// { | ||
// ["cookie-banner-acceptance-state"]: "true", | ||
// JSESSIONID: responseSession["set-cookie"]["JSESSIONID"], | ||
// INGRESSCOOKIE: ".", | ||
// }, | ||
// ); | ||
// console.log(responseReceipts); | ||
// const response = await MigrosAPI.account.cumulus.getCumulusReceipt( | ||
// { | ||
// receiptId: responseReceipts[0].id, | ||
// }, | ||
// { | ||
// JSESSIONID: responseSession["set-cookie"]["JSESSIONID"], | ||
// INGRESSCOOKIE: ".", | ||
// }, | ||
// ); | ||
// expect(response).toBe({}); | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
if (!process.env.CUMULUS_JSESSIONID || !process.env.CUMULUS_INGRESSCOOKIE) { | ||
console.log("Please provide JSESSIONID and INGRESSCOOKIE in .env"); | ||
return; | ||
} | ||
const responseReceipts = await MigrosAPI.account.cumulus.getCumulusReceipts( | ||
{ | ||
from: new Date("01.12.2023"), | ||
to: new Date(), | ||
}, | ||
{ | ||
["cookie-banner-acceptance-state"]: "true", | ||
JSESSIONID: process.env.CUMULUS_JSESSIONID, | ||
INGRESSCOOKIE: process.env.CUMULUS_INGRESSCOOKIE, | ||
}, | ||
); | ||
expect(responseReceipts).toBeInstanceOf(Array); | ||
const response = await MigrosAPI.account.cumulus.getCumulusReceipt( | ||
{ | ||
receiptId: responseReceipts[0].id, | ||
}, | ||
{ | ||
JSESSIONID: process.env.CUMULUS_JSESSIONID, | ||
INGRESSCOOKIE: process.env.CUMULUS_INGRESSCOOKIE, | ||
}, | ||
); | ||
expect(response).toHaveProperty("cumulus"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { describe, expect, test } from '@jest/globals'; | ||
// import { MigrosAPI } from "../src"; | ||
import { describe, expect, test } from "@jest/globals"; | ||
import { MigrosAPI } from "../src"; | ||
import * as dotenv from "dotenv"; | ||
import path from "path"; | ||
|
||
describe('Check for Migros Cumulus Receipts', () => { | ||
test('Retrieve Cumulus Receipts', async () => { | ||
/* | ||
const response = await MigrosAPI.account.cumulus.getCumulusReceipts({ | ||
from: new Date("01.04.2022"), | ||
to: new Date() | ||
}, { | ||
"BIGipServerpool_shared_migros.ch_80": ".", | ||
"cookie-banner-acceptance-state": ".", | ||
"mo-fulfilmentOption": ".", | ||
"mo-lang": ".", | ||
"mo-securityContext": ".", | ||
"mo-sidebarsState": ".", | ||
JSESSIONID: ".", | ||
REALPERSON_SESSION: "." | ||
}) | ||
*/ | ||
describe("Check for Migros Cumulus Receipts", () => { | ||
test("Retrieve Cumulus Receipts", async () => { | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
if (!process.env.CUMULUS_JSESSIONID || !process.env.CUMULUS_INGRESSCOOKIE) { | ||
console.log("Please provide JSESSIONID and INGRESSCOOKIE in .env"); | ||
return; | ||
} | ||
const responseReceipts = await MigrosAPI.account.cumulus.getCumulusReceipts( | ||
{ | ||
from: new Date("01.12.2023"), | ||
to: new Date(), | ||
}, | ||
{ | ||
["cookie-banner-acceptance-state"]: "true", | ||
JSESSIONID: process.env.CUMULUS_JSESSIONID, | ||
INGRESSCOOKIE: process.env.CUMULUS_INGRESSCOOKIE, | ||
}, | ||
); | ||
expect(responseReceipts).toBeInstanceOf(Array); | ||
}); | ||
}); | ||
|
||
expect(null).toBe(null) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters