Conversation
|
a30e7e4 to
3f688e1
Compare
| optionProps.renderAfterLabel = <IconArrowOpenEndSolid /> | ||
| optionProps['aria-haspopup'] = true | ||
| optionProps.role = customRole || 'button' | ||
| optionProps.role = customRole || 'menuitem' |
There was a problem hiding this comment.
Drilldown has role=menu, which should not have role=button children. We had a similar issue in the past: #1831 Also see the W3 spec: https://w3c.github.io/aria/#menu . Also this triggers a critical axe check failure (on our docs page too)
| // Add a small wait if your application might log errors asynchronously | ||
| cy.wait(100).then(() => { | ||
| expect(windowErrorSpy).to.not.be.called | ||
| expect(windowErrorSpy).to.have.callCount(0) |
There was a problem hiding this comment.
This makes it to output the actual error message to the console
3f688e1 to
5011c0e
Compare
| @@ -0,0 +1,62 @@ | |||
| /* | |||
There was a problem hiding this comment.
Note: All the component test pages were generated by AI using our READMEs as a basis. I dont think the code of these needs more than a very superficial checking, whats important how they look in Chromatic
5011c0e to
46be39d
Compare
| disabled: { cursor: 'not-allowed', opacity: 0.68 }, | ||
| 'highlighted-disabled': { | ||
| background: componentTheme.highlightedBackground, | ||
| color: componentTheme.highlightedLabelColor, | ||
| cursor: 'not-allowed', | ||
| opacity: 0.5 | ||
| cursor: 'not-allowed' |
There was a problem hiding this comment.
These needed the opacity to be increased, otherwise they would fail color contract a11y tests. AFAIK we are not using this directly anywhere, so it should be OK
| this._weekdayHeaderIds = ( | ||
| this.props.renderWeekdayLabels || this.defaultWeekdays | ||
| ).reduce((ids: Record<number, string>, _label, i) => { | ||
| return { ...ids, [i]: this.props.deterministicId!('weekday-header') } | ||
| }, {}) |
There was a problem hiding this comment.
SSR bugfix due to ID not being deterministic
| <Heading aiVariant="stacked" level="h2">Nutrition Facts</Heading> | ||
| <Heading aiVariant="horizontal" level="h3">Nutrition Facts</Heading> | ||
| <Heading aiVariant="iconOnly" level="h4">Nutrition Facts</Heading> |
There was a problem hiding this comment.
variant should be specified according to our own docs
There was a problem hiding this comment.
You mean level instead of variant I guess.
46be39d to
064a01c
Compare
| }, | ||
| "engines": { | ||
| "node": ">=18", | ||
| "node": ">=22", |
There was a problem hiding this comment.
I've updated this to be in sync with what we use in Github actions
| if (entry.isFile() && entry.name.includes('input')) { | ||
| const isWarningTest = entry.name.includes('.warning.input') | ||
| const inputPath = path.join(entry.path, entry.name) | ||
| const inputPath = path.join(entry.parentPath, entry.name) |
There was a problem hiding this comment.
entry.path is removed in Node 24, this is the recommended way since Node 20
| "@types/react-dom": "^18.3.0", | ||
| "@vitejs/plugin-react": "^4.5.1", | ||
| "@vitest/eslint-plugin": "^1.2.1", | ||
| "@types/node": "^22", |
There was a problem hiding this comment.
This must be added otherwise it will just pick up a @types/node version from a dependency
9570270 to
9df41e3
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request adds extensive regression tests for UI components and includes bug fixes for SSR and accessibility issues. The purpose is to expand test coverage for visual regression testing in a Next.js application environment, focusing on documenting and testing happy path scenarios for UI components.
Key changes include:
- Addition of 26+ new regression test pages covering major UI components
- Fix for SSR hydration mismatch in Calendar component's weekday header IDs
- Accessibility role corrections in Drilldown and Options components
Reviewed Changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| regression-test/src/app/*/page.tsx | New test pages for comprehensive component coverage including View, TreeBrowser, Tabs, Table, Select, and many others |
| packages/ui-calendar/src/Calendar/index.tsx | Fixed SSR issue by using deterministic IDs for weekday headers instead of random UIDs |
| packages/ui-drilldown/src/Drilldown/index.tsx | Fixed accessibility by changing default role from 'button' to 'menuitem' for subpage navigation |
| packages/ui-options/src/Options/Item/styles.ts | Improved accessibility contrast for disabled states |
| regression-test/cypress/e2e/spec.cy.ts | Updated test suite with new component test cases and improved assertion |
Comments suppressed due to low confidence (1)
regression-test/src/app/drilldown/page.tsx:162
- [nitpick] Using inline styles with opacity: 0 to hide icons is not the best practice. Consider using a proper placeholder component or conditional rendering instead of invisible elements.
renderBeforeLabel={<IconCheckSolid style={{ opacity: 0 }} />}
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9df41e3 to
217e194
Compare
| cy.checkA11y('.axe-test', axeOptions, terminalLog) | ||
| }) | ||
|
|
||
| it('check badge', () => { |
There was a problem hiding this comment.
please remove "check" from test names so it is cleaner (esp. in chromatic ui)
| </Flex.Item> | ||
| </Flex> | ||
| </View> | ||
| <div style={{ display: 'flex', gap: '0.5rem' }}> |
There was a problem hiding this comment.
I could fix this with a small delay
220c1c0 to
cda82e4
Compare
+1: Text input fields dont apply inner padding. I could not figure out why this is happening, they look good in Cypress. For some reason the CSS is not applied fully in Storybook, could be an SSR issue? I will make a ticket and fix it in the future |
in Calendar the weekday header IDs were getting out of sync because they were not deterministically generated
cda82e4 to
b3d442d
Compare
balzss
left a comment
There was a problem hiding this comment.
everything looks good (except the input fields which you mentioned will be addressed separately, if you create a ticket, please include the fact that the left and right sides of the textarea on form errors are cut off)
the disabled button is correct again, maybe because of the delay?
the github action fails with an npm install error which I've not seen before, please take a look at that, otherwise everything is ok 👍



These tests are mostly AI generated based on our README examples.
Calendar: inThe weekday header IDs were getting out of sync because they were not deterministically generatedDrilldown(see comments)Options(see comments)Note: The large rendering delays are needed because there is a large layout shift in some components that use
FormFieldLayoutwhen the hydration happens because we calculate the grid placement instyles.ts, so the barebones DOM is a half-complete grid.To test: