Skip to content

Commit 8c5c1e5

Browse files
committed
remove redundant license response template file
1 parent a916c4a commit 8c5c1e5

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

src/Frontend/test/mocks/license-response-template.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Frontend/test/preconditions/hasLicense.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import { activeLicenseResponse } from "../mocks/license-response-template";
1+
//import { activeLicenseResponse } from "../mocks/license-response-template";
22
import { SetupFactoryOptions } from "../driver";
33
import LicenseInfo, { LicenseStatus, LicenseType } from "@/resources/LicenseInfo";
44
import { useLicense } from "@/composables/serviceLicense";
55

66
const { license } = useLicense();
77

8-
export const hasActiveLicense = ({ driver }: SetupFactoryOptions) => {
9-
const serviceControlInstanceUrl = window.defaultConfig.service_control_url;
10-
driver.mockEndpoint(`${serviceControlInstanceUrl}license`, {
11-
body: activeLicenseResponse,
12-
});
13-
return activeLicenseResponse;
14-
};
15-
168
export const hasExpiredLicense = (licenseType: LicenseType, licenseExtensionUrl: string = "https://particular.net/extend-your-trial?p=servicepulse") => createLicenseMockedResponse(licenseType, false, licenseExtensionUrl);
179
export const hasExpiringLicense = (licenseType: LicenseType, licenseExtensionUrl: string = "https://particular.net/extend-your-trial?p=servicepulse") => createLicenseMockedResponse(licenseType, true, licenseExtensionUrl);
1810

src/Frontend/test/preconditions/licensing.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ const licenseResponseTemplate = <LicenseInfo>{
1414
license_status: LicenseStatus.Valid,
1515
status: "valid",
1616
};
17-
17+
export const hasActiveLicense = ({ driver }: SetupFactoryOptions) => {
18+
const serviceControlInstanceUrl = window.defaultConfig.service_control_url;
19+
driver.mockEndpoint(`${serviceControlInstanceUrl}license`, {
20+
body: licenseResponseTemplate,
21+
});
22+
return licenseResponseTemplate;
23+
};
1824
export const withExpiredLicense = (licenseType: LicenseType, expiredDays: number) => getLicenseMockedResponse(licenseType, expiredDays, true);
1925
export const withExpiringLicense = (licenseType: LicenseType, expiringInDays: number) => getLicenseMockedResponse(licenseType, expiringInDays, false);
2026

0 commit comments

Comments
 (0)