Skip to content

feat(evo-marko): evo-chip#630

Open
LuLaValva wants to merge 4 commits intomainfrom
evo-chip
Open

feat(evo-marko): evo-chip#630
LuLaValva wants to merge 4 commits intomainfrom
evo-chip

Conversation

@LuLaValva
Copy link
Copy Markdown
Member

  • Make <evo-chip> component
  • This one is very straightforward as it's a display component, should be a quick review

Copilot AI review requested due to automatic review settings April 17, 2026 20:57
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 793dcfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@evo-web/marko Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new evo-chip tag to the evo-marko package, providing a simple “chip” display component with an optional delete affordance, along with Storybook docs/examples and SSR/browser tests.

Changes:

  • Introduces the evo-chip Marko tag implementation with optional <@delete> attribute tag rendering a close icon button.
  • Adds Storybook stories and examples for default and deletable variants.
  • Adds SSR snapshot coverage and browser interaction/a11y assertions.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/evo-marko/src/tags/evo-chip/index.marko Implements the evo-chip tag markup, typings, and optional delete button.
packages/evo-marko/src/tags/evo-chip/style.ts Wires in Skin styles via @ebay/skin/chip.
packages/evo-marko/src/tags/evo-chip/chip.stories.ts Adds Storybook entry and argTypes for the component and <@delete> attribute tag.
packages/evo-marko/src/tags/evo-chip/examples/default.marko Default usage example.
packages/evo-marko/src/tags/evo-chip/examples/with-delete.marko Usage example demonstrating the delete button and a11yText.
packages/evo-marko/src/tags/evo-chip/test/test.server.ts Adds SSR snapshot tests via Storybook stories.
packages/evo-marko/src/tags/evo-chip/test/test.browser.ts Adds browser tests for rendering, a11y label, and click behavior.
packages/evo-marko/src/tags/evo-chip/README.md Adds component README content and external links.

Comment on lines +13 to +51
describe("default", () => {
beforeEach(async () => {
component = await render(Default);
});

it("should render chip text", () => {
expect(component.getByText("chip text")).toBeTruthy();
});

it("should not render a delete button", () => {
expect(component.queryByRole("button")).toBeNull();
});
});

describe("with delete button", () => {
beforeEach(async () => {
component = await render(WithDelete);
});

it("should render a delete button", () => {
expect(component.getByRole("button")).toBeTruthy();
});

it("should have aria-label on delete button", () => {
expect(
component.getByRole("button").getAttribute("aria-label"),
).toBe("Delete");
});

describe("when delete button is clicked", () => {
beforeEach(async () => {
await fireEvent.click(component.getByRole("button"));
});

it("should emit click event", () => {
expect(component.emitted("click")).has.length(1);
});
});
});
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These test files are not formatted according to the repo’s Prettier defaults (e.g., 2-space indentation used in other Vitest test files). Since packages/evo-marko/package.json runs prettier . --check in CI, this will likely fail formatting checks. Please run Prettier (or align indentation/import formatting) for this file.

Suggested change
describe("default", () => {
beforeEach(async () => {
component = await render(Default);
});
it("should render chip text", () => {
expect(component.getByText("chip text")).toBeTruthy();
});
it("should not render a delete button", () => {
expect(component.queryByRole("button")).toBeNull();
});
});
describe("with delete button", () => {
beforeEach(async () => {
component = await render(WithDelete);
});
it("should render a delete button", () => {
expect(component.getByRole("button")).toBeTruthy();
});
it("should have aria-label on delete button", () => {
expect(
component.getByRole("button").getAttribute("aria-label"),
).toBe("Delete");
});
describe("when delete button is clicked", () => {
beforeEach(async () => {
await fireEvent.click(component.getByRole("button"));
});
it("should emit click event", () => {
expect(component.emitted("click")).has.length(1);
});
});
});
describe("default", () => {
beforeEach(async () => {
component = await render(Default);
});
it("should render chip text", () => {
expect(component.getByText("chip text")).toBeTruthy();
});
it("should not render a delete button", () => {
expect(component.queryByRole("button")).toBeNull();
});
});
describe("with delete button", () => {
beforeEach(async () => {
component = await render(WithDelete);
});
it("should render a delete button", () => {
expect(component.getByRole("button")).toBeTruthy();
});
it("should have aria-label on delete button", () => {
expect(
component.getByRole("button").getAttribute("aria-label"),
).toBe("Delete");
});
describe("when delete button is clicked", () => {
beforeEach(async () => {
await fireEvent.click(component.getByRole("button"));
});
it("should emit click event", () => {
expect(component.emitted("click")).has.length(1);
});
});
});

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +15
it("renders default", async () => {
await snapshotHTML(Default);
});

it("renders with delete button", async () => {
await snapshotHTML(WithDelete);
});
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn’t follow the repository’s standard Prettier formatting (notably indentation), which is enforced by prettier . --check in the evo-marko lint script. Please run Prettier / reformat so it matches the surrounding test conventions.

Suggested change
it("renders default", async () => {
await snapshotHTML(Default);
});
it("renders with delete button", async () => {
await snapshotHTML(WithDelete);
});
it("renders default", async () => {
await snapshotHTML(Default);
});
it("renders with delete button", async () => {
await snapshotHTML(WithDelete);
});

Copilot uses AI. Check for mistakes.
Comment thread packages/evo-marko/src/tags/evo-chip/chip.stories.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants