Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2stack specificStack: react
reactreduxtestingcontainers
Render the connected container when a test asserts on it
When a page renders a connected container, import and assert against that container in tests rather than the unconnected presentational component name.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | component.find('ChannelList').should.have.length(1); // string name misses the container |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | import ChannelList from 'view/container/ChannelList'; |
| 2 | component.find(<ChannelList />).should.have.length(1); |
Explanation (EN)
Objašnjenje (HR)