Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(site): refactor e2e tests for deployment/licenses#12926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 1 commit intomainfrom12508-e2e-deployment-3
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
30 changes: 30 additions & 0 deletionssite/e2e/tests/deployment/licenses.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
import { expect, test } from "@playwright/test";
import { requiresEnterpriseLicense } from "../../helpers";

test("license was added successfully", async ({ page }) => {
requiresEnterpriseLicense();

await page.goto("/deployment/licenses", { waitUntil: "domcontentloaded" });
const firstLicense = page.locator(".licenses > .license-card", {
hasText: "#1",
});
await expect(firstLicense).toBeVisible();

// Trial vs. Enterprise?
const accountType = firstLicense.locator(".account-type");
await expect(accountType).toHaveText("Enterprise");

// User limit 1/1
const userLimit = firstLicense.locator(".user-limit");
await expect(userLimit).toHaveText("1 / 1");

// License should not be expired yet
const licenseExpires = firstLicense.locator(".license-expires");
const licenseExpiresDate = new Date(await licenseExpires.innerText());
const now = new Date();
expect(licenseExpiresDate.getTime()).toBeGreaterThan(now.getTime());

// "Remove" button should be visible
const removeButton = firstLicense.locator(".remove-button");
await expect(removeButton).toBeVisible();
});
10 changes: 0 additions & 10 deletionssite/e2e/tests/enterprise.spec.ts
View file
Open in desktop

This file was deleted.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,7 +32,12 @@ export const LicenseCard: FC<LicenseCardProps> = ({
license.claims.features["user_limit"] || userLimitLimit;

return (
<Paper key={license.id} elevation={2} css={styles.licenseCard}>
<Paper
key={license.id}
elevation={2}
css={styles.licenseCard}
className="license-card"
>
<ConfirmDialog
type="delete"
hideCancel={false}
Expand All@@ -58,7 +63,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
alignItems="center"
>
<span css={styles.licenseId}>#{license.id}</span>
<span css={styles.accountType}>
<span css={styles.accountType} className="account-type">
{license.claims.trial ? "Trial" : "Enterprise"}
</span>
<Stack
Expand All@@ -72,7 +77,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
>
<Stack direction="column" spacing={0} alignItems="center">
<span css={styles.secondaryMaincolor}>Users</span>
<span css={styles.userLimit}>
<span css={styles.userLimit} className="user-limit">
{userLimitActual} {` / ${currentUserLimit || "Unlimited"}`}
</span>
</Stack>
Expand All@@ -92,7 +97,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
) : (
<span css={styles.secondaryMaincolor}>Valid Until</span>
)}
<span css={styles.licenseExpires}>
<span css={styles.licenseExpires} className="license-expires">
{dayjs
.unix(license.claims.license_expires)
.format("MMMM D, YYYY")}
Expand All@@ -104,6 +109,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
variant="contained"
size="small"
onClick={() => setLicenseIDMarkedForRemoval(license.id)}
className="remove-button"
>
Remove&hellip;
</Button>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,7 +84,7 @@ const LicensesSettingsPageView: FC<Props> = ({
{isLoading && <Skeleton variant="rectangular" height={200} />}

{!isLoading && licenses && licenses?.length > 0 && (
<Stack spacing={4}>
<Stack spacing={4} className="licenses">
{licenses
?.sort(
(a, b) =>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp