Skip to content

Commit

Permalink
fix(web): table-related and small bugs (#1103)
Browse files Browse the repository at this point in the history
* fix:  disable upload button when selecting nothing

* add: clear btn on search input field on all tables

* fix: the behavior of updating tag from the edit page

* hide first column from table setting of table on modal

* fix: make the columns resizable on modal table

* fix: placeholder in test
  • Loading branch information
caichi-t authored Mar 19, 2024
1 parent ac66e45 commit 9679911
Show file tree
Hide file tree
Showing 22 changed files with 843 additions and 706 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
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
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 9679911

Please sign in to comment.