MarqueeSelection test snapshot is too verbose and thus fragile
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? No: no time to investigate right now, not familiar with the APIs here, someone more familiar could probably fix it in a tenth of the time
Requested priority: Normal
Describe the issue:
The MarqueeSelection test is too fragile.
https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/MarqueeSelection The snapshot for MarqueeSelection also includes the theme object because it snapshots like this:
// Run snapshot test.
const tree = toJson(component);
expect(tree).toMatchSnapshot();
instead of how all other tests do it:
const tree = component.toJson();
because it is mounted.
Any changes to the theming interface will unexpectedly cause the MarqueeSelection test to fail.
added to backlog with reference back to this issue.
@JasonGore are you familiar with how this could be fixed? Is this really even an issue?
~~Yeah we just need to change the snapshot test to use MarqueeSelectionBase instead.~~ Oops nevermind, we should probably do the whole component to capture styling. Just need to check how it's different from other snapshot tests like reporter mentioned.
@JasonGore I think the correct fix is: expect(component.getDOMNode()).toMatchSnapshot();
Similar to the question I asked in the Fabric channel earlier this week regarding DetailsList testing. Kind of drowning in PRs at the moment though, can get around to this next week or if someone on your team could, that'd be great too.