Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Frontend/test/preconditions/licensing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ const getLicenseMockedResponse =
function getCustomDateISOString(daysCount: number, isExpired: boolean) {
const today = new Date();
const customDate = new Date(today);
// Set hours, minutes, seconds, and milliseconds to 00
today.setHours(0, 0, 0, 0);
customDate.setHours(0, 0, 0, 0);

if (isExpired) {
customDate.setDate(today.getDate() - daysCount);
Expand Down
10 changes: 5 additions & 5 deletions src/Frontend/test/specs/configuration/viewing-license.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("FEATURE: License", () => {
describe("RULE: License expiring soon must be displayed", () => {
test("EXAMPLE: License expiring in 11 days", async ({ driver }) => {
await driver.setUp(precondition.serviceControlWithMonitoring);
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, 10));
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, 11));
await driver.goTo("/configuration/license");
await waitFor(async () => {
expect(await licenseExpiryDaysLeft()).toBeVisible();
Expand All @@ -64,7 +64,7 @@ describe("FEATURE: License", () => {
});
test("EXAMPLE: License expiring tomorrow", async ({ driver }) => {
await driver.setUp(precondition.serviceControlWithMonitoring);
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, 0));
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, 1));
await driver.goTo("/configuration/license");
await waitFor(async () => {
expect(await licenseExpiryDaysLeft()).toBeVisible();
Expand All @@ -73,7 +73,7 @@ describe("FEATURE: License", () => {
});
test("EXAMPLE: License expiring today", async ({ driver }) => {
await driver.setUp(precondition.serviceControlWithMonitoring);
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, -1));
await driver.setUp(precondition.hasExpiringLicense(LicenseType.Subscription, 0));
await driver.goTo("/configuration/license");
await waitFor(async () => {
expect(await licenseExpiryDaysLeft()).toBeVisible();
Expand All @@ -85,7 +85,7 @@ describe("FEATURE: License", () => {
describe("RULE: Upgrade Protection license expiring soon must be displayed with a reference to how much time is left and a warning:'Once upgrade protection expires, you'll no longer have access to support or new product versions. '", () => {
test("EXAMPLE: Upgrade Protection license expiring in 11 days", async ({ driver }) => {
await driver.setUp(precondition.serviceControlWithMonitoring);
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 10));
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 11));
await driver.goTo("/configuration/license");
await waitFor(async () => {
expect(await licenseExpiryDaysLeft()).toBeVisible();
Expand All @@ -94,7 +94,7 @@ describe("FEATURE: License", () => {
});
test("EXAMPLE: Upgrade Protection license expiring tomorrow", async ({ driver }) => {
await driver.setUp(precondition.serviceControlWithMonitoring);
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 0));
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 1));
await driver.goTo("/configuration/license");
await waitFor(async () => {
expect(await licenseExpiryDaysLeft()).toBeVisible();
Expand Down