-
Notifications
You must be signed in to change notification settings - Fork 54
fix(Status): fix order of applied props #961
Conversation
Codecov Report
@@ Coverage Diff @@
## master #961 +/- ##
==========================================
+ Coverage 80.7% 80.72% +0.01%
==========================================
Files 659 659
Lines 8459 8465 +6
Branches 1431 1495 +64
==========================================
+ Hits 6827 6833 +6
Misses 1618 1618
Partials 14 14
Continue to review full report at Codecov.
|
expect(element.prop('role')).toBe(role) | ||
}) | ||
|
||
test('attributes passed by consumer has more weight', () => { |
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.
nit-nit: maybe we could just state supported scenario, like client's attributes override the ones provided by Stardust
test('attributes passed by consumer has more weight', () => { | ||
const wrapper = mount( | ||
<Component | ||
{...{ ...requiredProps, [IS_FOCUSABLE_ATTRIBUTE]: false }} |
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.
would suggest to make it a bit more readable:
const clientAttributes = {
[IS_FOCUSABLE_ATTRIBUTE]: false,
accessibility: noopBehavior
}
const wrapper = mount(<Component {...requiredProps} {...clientAttributes} />
...
expect(element.prop('role')).toBe(role) | ||
}) | ||
|
||
test('attributes passed by consumer has more weight', () => { |
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.
👍 thanks for adding this one!
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.
would like @jurokapsiar to take a look on these changes, just to be absolutely sure this strategy won't get into conflict with existing accessibility behaviours
Fixes #958.