-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactor: simplify observers setup, improve tests #8622
refactor: simplify observers setup, improve tests #8622
Conversation
@@ -598,32 +581,25 @@ describe('form layout', () => { | |||
expect(unhiddenItemWidth).to.equal(itemWidth); | |||
}); | |||
|
|||
it('should update layout after updating a colspan attribute on the lazily stamped node', async () => { | |||
container.push('items', { label: 'Email', colspan: 1 }); |
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.
note: It seems pointless to test that FormLayout picks up on DOM changes caused by Polymer specifically.
|
||
/** @private */ | ||
_getObservableNodes(nodeList) { | ||
const ignore = ['template', 'style', 'dom-repeat', 'dom-if']; |
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.
note: This seems like an old logic to support Polymer templates, which we no longer support, as far as I remember.
64027f0
to
15137a6
Compare
…simplify-observers-and-tests
…simplify-observers-and-tests
|
Description
The PR simplifies the MutationObserver setup in FormLayout by using
subtree: true
instead of observing each child element individually. The PR also improves the tests to ensure they cover these observers. Previously, the tests were passing even without the observers because adding and removing new elements triggered a resize event, which in turn triggered a layout update expected by the test.Depends on
Part of #8583
Type of change