Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/reearth/reearth-cms into re…
Browse files Browse the repository at this point in the history
…factor-web/types
  • Loading branch information
caichi-t committed Mar 19, 2024
2 parents 0d12d5f + 9679911 commit 6079647
Show file tree
Hide file tree
Showing 45 changed files with 1,202 additions and 1,189 deletions.
8 changes: 4 additions & 4 deletions web/e2e/project/asset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ test("Asset CRUD and Searching has succeeded", async ({ page }) => {
await expect(page.getByRole("alert").last()).toContainText("Successfully added asset!");
await closeNotification(page);
await expect(page.getByText(uploadFileName)).toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("no asset");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("no asset");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByText(uploadFileName)).not.toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByText(uploadFileName)).toBeVisible();
await page.getByLabel("edit").locator("svg").click();
Expand Down
13 changes: 4 additions & 9 deletions web/e2e/project/content.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ test.afterEach(async ({ page }) => {
});

test("Item CRUD and searching has succeeded", async ({ page }) => {
await page
.locator("li")
.filter({ hasText: "TextHeading and titles, one-" })
.locator("div")
.first()
.click();
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click();
await handleFieldForm(page, "text");
await closeNotification(page);
await page.getByText("Content").click();
Expand All @@ -34,11 +29,11 @@ test("Item CRUD and searching has succeeded", async ({ page }) => {
await closeNotification(page);
await page.getByLabel("Back").click();
await expect(page.getByRole("cell", { name: "text", exact: true })).toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("no field");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("no field");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByRole("cell", { name: "text", exact: true })).not.toBeVisible();
await page.getByPlaceholder("Please enter").fill("");
await page.getByPlaceholder("input search text").fill("");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByRole("cell", { name: "text", exact: true })).toBeVisible();
await page.getByRole("link", { name: "edit", exact: true }).click();
Expand Down
8 changes: 4 additions & 4 deletions web/e2e/project/item/fields/asset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ test("Asset field editing has succeeded", async ({ page }) => {
await expect(page.getByRole("button", { name: uploadFileName_1, exact: true })).toBeVisible();
await page.getByLabel("Default value").getByRole("button").nth(3).click();
await page.getByRole("button", { name: "Asset" }).click();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("no asset");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("no asset");
await page.getByRole("button", { name: "search" }).click();
await expect(page.locator(".ant-table-row").first()).not.toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("");
await page.getByRole("button", { name: "search" }).click();
await page.locator(".ant-table-row > td").first().getByRole("button").hover();
await page.locator(".ant-table-row > td").first().getByRole("button").click();
Expand Down
2 changes: 2 additions & 0 deletions web/e2e/project/item/fields/group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ test("Group field creating and updating has succeeded", async ({ page }) => {
await expect(page.getByRole("alert").last()).toContainText("Successfully updated field!");
await closeNotification(page);
await page.getByText("Content").click();
await page.getByText("e2e model name").click();
await page.getByRole("link", { name: "edit", exact: true }).click();
await expect(page.getByRole("main")).toContainText("new text1(unique)");
await expect(page.getByRole("main")).toContainText("new text1 description");
Expand Down Expand Up @@ -304,6 +305,7 @@ test("Group field editing has succeeded", async ({ page }) => {
await closeNotification(page);

await page.getByText("Content").click();
await page.getByText("e2e model name").click();
await page.getByRole("button", { name: "plus New Item" }).click();
await page.getByRole("button", { name: "plus New" }).click();
await expect(page.getByRole("textbox").nth(0)).toHaveValue("text1");
Expand Down
6 changes: 3 additions & 3 deletions web/e2e/project/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ test("Request creating, searching, updating reviewer, and approving has succeede
await page.getByText("Request", { exact: true }).click();
await expect(page.getByText(requestTitle, { exact: true })).toBeVisible();
await expect(page.getByText("WAITING")).toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("no request");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("no request");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByText(requestTitle, { exact: true })).not.toBeVisible();
await expect(page.getByText("WAITING")).not.toBeVisible();
await page.getByPlaceholder("Please enter").fill("");
await page.getByPlaceholder("input search text").fill("");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByText(requestTitle, { exact: true })).toBeVisible();
await expect(page.getByText("WAITING")).toBeVisible();
Expand Down
44 changes: 38 additions & 6 deletions web/e2e/project/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,46 @@ test("Group CRUD has succeeded", async ({ page }) => {
await crudGroup(page);
});

test("Group creating from adding field has succeeded", async ({ page }) => {
await createModel(page);
await page.locator("li").filter({ hasText: "Group" }).locator("div").first().click();
await page.getByRole("button", { name: "Create Group" }).click();
await expect(page.getByLabel("New Group")).toContainText("New Group");
await expect(page.getByRole("button", { name: "OK" })).toBeDisabled();

await page.getByLabel("New Group").locator("#name").click();
await page.getByLabel("New Group").locator("#name").fill("e2e group name");
await page.getByLabel("New Group").locator("#key").click();
await page.getByLabel("New Group").locator("#key").fill("e2e-group-key");
await page.getByRole("button", { name: "OK" }).click();
await expect(page.getByRole("alert").last()).toContainText("Successfully created group!");
await closeNotification(page);
await expect(
page.getByRole("menuitem", { name: "e2e group name" }).locator("span"),
).toBeVisible();
await expect(page.getByText("e2e group name#e2e-group-key")).toBeVisible();
await expect(page.getByText("FieldsMeta Data")).not.toBeVisible();
await expect(
page.locator("li").filter({ hasText: "Reference" }).locator("div").first(),
).not.toBeVisible();
await expect(
page.locator("li").filter({ hasText: "Group" }).locator("div").first(),
).not.toBeVisible();
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click();
await handleFieldForm(page, "text");
await expect(page.getByRole("alert").last()).toContainText("Successfully created field!");
await closeNotification(page);
await page.getByText("e2e model name").click();
await page.locator("li").filter({ hasText: "Group" }).locator("div").first().click();
await expect(page.getByRole("heading", { name: "Create Group" })).toBeVisible();
await page.getByLabel("Select Group").click();
await expect(page.getByText("e2e group name #e2e-group-key")).toBeVisible();
await page.getByRole("button", { name: "Cancel" }).click();
});

test("Text field CRUD has succeeded", async ({ page }) => {
await createModel(page);
await page
.locator("li")
.filter({ hasText: "TextHeading and titles, one-" })
.locator("div")
.first()
.click();
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click();
await handleFieldForm(page, "text");
await expect(page.getByRole("alert").last()).toContainText("Successfully created field!");
await closeNotification(page);
Expand Down
1 change: 0 additions & 1 deletion web/e2e/project/utils/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export async function createGroup(page: Page) {
await page.getByRole("button", { name: "OK" }).click();
await expect(page.getByRole("alert").last()).toContainText("Successfully created group!");
await closeNotification(page);
await page.getByText("e2e group name").click();
await expect(page.getByTitle("e2e group name")).toBeVisible();
await expect(page.getByText("#e2e-group-key")).toBeVisible();
}
Expand Down
12 changes: 6 additions & 6 deletions web/e2e/settings/integrations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ test("Integration CRUD and searching has succeeded", async ({ reearth, page }) =
);
await closeNotification(page);
await expect(page.getByRole("cell", { name: "e2e integration name", exact: true })).toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("e2e integration name");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("e2e integration name");
await page.getByRole("button", { name: "search" }).click();
await page.getByRole("cell", { name: "setting" }).locator("svg").click();
await page
Expand All @@ -48,14 +48,14 @@ test("Integration CRUD and searching has succeeded", async ({ reearth, page }) =
);
await closeNotification(page);
await expect(page.getByRole("cell", { name: "WRITER" })).toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("no integration");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("no integration");
await page.getByRole("button", { name: "search" }).click();
await expect(
page.getByRole("cell", { name: "e2e integration name", exact: true }),
).not.toBeVisible();
await page.getByPlaceholder("Please enter").click();
await page.getByPlaceholder("Please enter").fill("e2e integration name");
await page.getByPlaceholder("input search text").click();
await page.getByPlaceholder("input search text").fill("e2e integration name");
await page.getByRole("button", { name: "search" }).click();
await expect(page.getByRole("cell", { name: "e2e integration name", exact: true })).toBeVisible();
await page.getByLabel("", { exact: true }).check();
Expand Down
3 changes: 0 additions & 3 deletions web/src/components/molecules/Asset/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Props = {
totalCount: number;
page: number;
pageSize: number;
searchTerm: string;
onAssetItemSelect: (item: AssetItem) => void;
onAssetSelect: (assetId: string) => void;
onUploadModalCancel: () => void;
Expand Down Expand Up @@ -65,7 +64,6 @@ const AssetList: React.FC<Props> = ({
uploadType,
selectedAsset,
totalCount,
searchTerm,
page,
pageSize,
onAssetItemSelect,
Expand Down Expand Up @@ -146,7 +144,6 @@ const AssetList: React.FC<Props> = ({
loading={loading}
selectedAsset={selectedAsset}
totalCount={totalCount}
searchTerm={searchTerm}
page={page}
pageSize={pageSize}
onAssetItemSelect={onAssetItemSelect}
Expand Down
Loading

0 comments on commit 6079647

Please sign in to comment.