Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JensSpanier committed Aug 8, 2023
1 parent 4764761 commit 846d54d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions specs/PKPass.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,12 @@ describe("PKPass", () => {

describe("expiration date", () => {
it("should set a pass expiration date", () => {
pkpass.setExpirationDate(new Date(2023, 3, 10));
pkpass.setExpirationDate(new Date("2023-04-09T17:00-07:00"));

const passjsonGenerated = getGeneratedPassJson(pkpass);

expect(passjsonGenerated.expirationDate).toBe(
"2023-04-10T00:00:00Z",
"2023-04-10T00:00:00.000Z",
);
});

Expand Down Expand Up @@ -808,11 +808,11 @@ describe("PKPass", () => {

describe("relevant date", () => {
it("should set pass relevant date", () => {
pkpass.setRelevantDate(new Date(2023, 3, 10, 14, 15));
pkpass.setRelevantDate(new Date("2023-04-11T00:15+10:00"));

const passjsonGenerated = getGeneratedPassJson(pkpass);

expect(passjsonGenerated.relevantDate).toBe("2023-04-10T14:15:00Z");
expect(passjsonGenerated.relevantDate).toBe("2023-04-10T14:15:00.000Z");
});

it("should reset relevant date", () => {
Expand Down
4 changes: 2 additions & 2 deletions specs/utils.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe("Utils", () => {
});

it("should convert a Date object to a valid W3C date", () => {
expect(processDate(new Date(2020, 6, 1, 0, 0, 0, 0))).toBe(
"2020-07-01T00:00:00Z",
expect(processDate(new Date("2020-07-01T02:00+02:00"))).toBe(
"2020-07-01T00:00:00.000Z",
);
});
});
Expand Down

0 comments on commit 846d54d

Please sign in to comment.