Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a new wizard-based Create Artifact modal #4883

Merged
merged 3 commits into from
Jul 12, 2024
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
56 changes: 28 additions & 28 deletions typescript-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 29 additions & 9 deletions ui/tests/specs/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,42 @@ test("End to End - Create artifact", async ({ page }) => {

// Click the "Create artifact" button
await page.getByTestId("btn-toolbar-create-artifact").click();
await expect(page.getByTestId("create-artifact-form-group")).toHaveValue("");
await expect(page.getByTestId("create-artifact-modal-group")).toHaveValue("");

// Create a new artifact
await page.getByTestId("create-artifact-form-group").fill("e2e");
await page.getByTestId("create-artifact-form-id").fill("MyArtifact");
await page.getByTestId("create-artifact-form-type-select").click();
await page.getByTestId("create-artifact-form-OPENAPI").click();

// Fill out page 1 of the create artifact wizard
await page.getByTestId("create-artifact-modal-group").fill("e2e");
await page.getByTestId("create-artifact-modal-id").fill("MyArtifact");
await page.getByTestId("create-artifact-modal-type-select").click();
await page.getByTestId("create-artifact-modal-OPENAPI").click();

// Click "Next" on the wizard
await page.locator("#next-wizard-page").click();

// Fill out page 2 of the create artifact wizard
await page.getByTestId("create-artifact-modal-artifact-metadata-name").fill("Test Artifact");
await page.getByTestId("create-artifact-modal-artifact-metadata-description").fill("Artifact description.");

// Click "Next" on the wizard
await page.locator("#next-wizard-page").click();

// Fill out page 3 of the create artifact wizard
await page.getByTestId("create-artifact-modal-version").fill("1.0.0");
await page.locator("#artifact-content").fill(OPENAPI_DATA_STR);
await page.getByTestId("create-artifact-modal-btn-create").click();

// Click "Next" on the wizard
await page.locator("#next-wizard-page").click();

// Leave page 4 empty and click "Complete"
await page.locator("#next-wizard-page").click();

// Make sure we redirected to the artifact page.
await expect(page).toHaveURL(/.+\/explore\/e2e\/MyArtifact/);

// Assert the meta-data is as expected
await expect(page.getByTestId("artifact-details-name")).toHaveText("No name");
await expect(page.getByTestId("artifact-details-description")).toHaveText("No description");
await expect(page.getByTestId("artifact-details-name")).toHaveText("Test Artifact");
await expect(page.getByTestId("artifact-details-description")).toHaveText("Artifact description.");
await expect(page.getByTestId("artifact-details-labels")).toHaveText("No labels");
});

Expand All @@ -41,7 +61,7 @@ test("End to End - Edit artifact metadata", async ({ page }) => {

// Click the "Edit" button to show the modal
await page.getByTestId("artifact-btn-edit").click();
await expect(page.getByTestId("edit-metadata-modal-name")).toBeEmpty();
await expect(page.getByTestId("edit-metadata-modal-name")).toHaveValue("Test Artifact");

// Change/add some values
await page.getByTestId("edit-metadata-modal-name").fill("Empty API Spec");
Expand Down
8 changes: 4 additions & 4 deletions ui/ui-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/ui-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"vite-tsconfig-paths": "4.3.2"
},
"dependencies": {
"@apicurio/common-ui-components": "2.0.1",
"@apicurio/common-ui-components": "2.0.2",
"@apicurio/apicurio-registry-sdk": "file:../../typescript-sdk",
"@apicurio/data-models": "1.1.27",
"@microsoft/kiota-abstractions": "1.0.0-preview.57",
Expand Down
17 changes: 0 additions & 17 deletions ui/ui-app/src/app/components/modals/CreateArtifactForm.css

This file was deleted.

Loading
Loading