-
Notifications
You must be signed in to change notification settings - Fork 224
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
feat: Add parts
property on createStencil
for better type safety
#3134
base: prerelease/minor
Are you sure you want to change the base?
feat: Add parts
property on createStencil
for better type safety
#3134
Conversation
|
Workday/canvas-kit
|
Project |
Workday/canvas-kit
|
Branch Review |
mc-magic-strings
|
Run status |
|
Run duration | 02m 21s |
Commit |
|
Committer | Manuel Carrera |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
1
|
|
7
|
|
0
|
|
345
|
View all changes introduced in this branch ↗︎ |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
14.5%
|
|
---|---|
|
1060
|
|
177
|
Accessibility
96.88%
|
|
---|---|
|
4 critical
3 serious
0 moderate
2 minor
|
|
91
|
Tests for review
Breadcrumbs.spec.tsx • 1 failed test
Test | Artifacts | |
---|---|---|
given the [Components/Navigation/Breadcrumbs, Overflow Breadcrumbs] menu is rendered > should not have any axe errors |
Test Replay
Screenshots
|
The first 5 failed specs are shown, see all 30 specs in Cypress Cloud.
cypress/component/SelectPreview.spec.tsx • 1 flaky test
Test | Artifacts | |
---|---|---|
... > when the down arrow key is pressed > the menu > should have focus |
Test Replay
Screenshots
|
vars: { | ||
separator: '', | ||
}, | ||
parts: { | ||
separator: 'card-separator', | ||
bar: 'foo', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vars: { | |
separator: '', | |
}, | |
parts: { | |
separator: 'card-separator', | |
bar: 'foo', | |
}, |
[`:has(${separatorPart})`]: { | ||
backgroundColor: 'red', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[`:has(${separatorPart})`]: { | |
backgroundColor: 'red', | |
}, |
const testStencil = createStencil({ | ||
extends: cardStencil, | ||
parts: { | ||
test: 'test-part', | ||
}, | ||
base: ({separator, testPart, separatorPart}) => ({ | ||
[`:has(${separatorPart})`]: { | ||
color: 'red', | ||
}, | ||
[`:has(${testPart})`]: { | ||
backgroundColor: 'blue', | ||
}, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const testStencil = createStencil({ | |
extends: cardStencil, | |
parts: { | |
test: 'test-part', | |
}, | |
base: ({separator, testPart, separatorPart}) => ({ | |
[`:has(${separatorPart})`]: { | |
color: 'red', | |
}, | |
[`:has(${testPart})`]: { | |
backgroundColor: 'blue', | |
}, | |
}), |
<div data-part={testStencil.parts.separator}>foo</div> | ||
<div data-part={testStencil.parts.test}>test</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div data-part={testStencil.parts.separator}>foo</div> | |
<div data-part={testStencil.parts.test}>test</div> |
@@ -1188,6 +1216,7 @@ export function createStencil< | |||
}; | |||
}) as any; | |||
|
|||
stencil.parts = {...composes?.parts, ..._parts} as P; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicholasBoll it is very unhappy about this.
Summary
Fixes: #3118
Release Category
Utils
Release Note
Optional release note message. Changelog and release summaries will contain a pull request title. This section will add additional notes under that title. This section is not a summary, but something extra to point out in release notes. An example might be calling out breaking changes in a labs component or minor visual changes that need visual regression updates. Remove this section if no additional release notes are required.
Checklist
ready for review
has been added to PRFor the Reviewer
Where Should the Reviewer Start?
Areas for Feedback? (optional)
Testing Manually
Screenshots or GIFs (if applicable)
Thank You Gif (optional)