refactor(atomic): migrate atomic-insight-numeric-facet from Stencil to Lit#6974
Conversation
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
|
@copilot Delete the atomic-insight-numeric-facet.tsx. Verify that all styles in .pcss have been properly converted into the static styles property of the migrated component, then delete the old .pcss file. Once this is done, proceed to the next step (storybook, e2e tests). You can skip documentation: Insight components are considered "interna". |
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Completed in commits fa6bf81 and f765854: ✅ Deleted files:
✅ Created Storybook stories with MSW API mocking:
✅ Created Playwright E2E tests:
Documentation skipped as noted (Insight components are internal). |
|
@copilot I looked at patterns for other components that were migrated in the Insight use case. I changed my mind, let's remove the @internal tag from the JSDoc (otherwise the Stories won't even render as the component won't be in the manifest). Let's also generate an mdx file. It should be fairly similar to the one we have for atomic-numeric-facet I noticed something else while looking at the way the e2e tests are organized. According to our test guidelines, all tests in the file should be grouped under a single describe block. Rework the .e2e.ts file accordingly. For the sake of consistency, also rework the atomic-numeric-facet.e2e.ts file in the same fashion (out of scope, but acceptable scope creep). |
…ngle describe blocks Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Completed in commit b842ad4: ✅ Removed @internal tag from JSDoc in ✅ Created MDX documentation:
✅ Consolidated E2E tests to single describe block:
All tests maintain same coverage, just reorganized per test guidelines. |
✅ Checklist
.mdxfileindex.tsandlazy-index.tsfiles.https://coveord.atlassian.net/browse/KIT-4854
Description
Migrated
atomic-insight-numeric-facetfrom Stencil to Lit following the patterns established inatomic-numeric-facet(search use case). The migration includes complete test coverage, Storybook stories with MSW API mocking, Playwright E2E tests, and full documentation.Changes
Component Migration
atomic-insight-numeric-facet.ts(648 lines)@Component→@customElement,@Prop()→@property(),@State()→@state()htmltemplates withwhendirective for conditional renderinginitialize(), properconnectedCallback/disconnectedCallbackwith cleanup@/path aliases (no relative../imports)connectedCallback, removed indisconnectedCallbacknumeric-facet-common.tw.cssatomic-insight-numeric-facet.tsx(old Stencil) andatomic-insight-numeric-facet.pcss(old CSS)@internalJSDoc tag to ensure component appears in Storybook manifestUnit Tests
atomic-insight-numeric-facet.spec.ts(1024 lines)renderInAtomicInsightInterfacewith search controller fixtures (compatible)mockConsoleutility for console mocking following best practicesStorybook Stories
atomic-insight-numeric-facet.new.stories.tsxMockInsightApiwith MSW handlers for API mockingDocumentation
atomic-insight-numeric-facet.mdxatomic-insight-interfacePlaywright E2E Tests
e2e/fixture.ts,e2e/page-object.ts,e2e/atomic-insight-numeric-facet.e2e.tsdescribeblock per test guidelinesatomic-numeric-facet.e2e.tsto follow same pattern (consolidated from 5 describe blocks to 1)Key Differences from Search Version
tabsIncluded/tabsExcludedprops (insight doesn't use tabs)TabManagercontroller@coveo/headless/insightimportsNotes
.pcssonly imported common styles, now usingnumeric-facet-common.tw.cssin Lit componentmockConsoleutility patternOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.