Repository navigation
test(playwright): scope the SearchRBAC no-result assertion to its entity category - #30800
Conversation
…ity category
"Table Column > User without permission" fails deterministically on both
1.13 AUT runs, in two different ways that share one cause:
MySQL expect(locator).not.toBeAttached() failed
locator('[data-testid="entity-header-display-name"]')
.filter({ hasText: 'user_ida06c5f92' }) -- was attached
PostgreSQL expect(locator).toBeVisible() failed
getByTestId('no-search-results').getByText('No result found.')
searchForEntityShouldWorkShowNoResult searches globally and then asserts
absence against whatever entity category Explore happens to be showing.
A match from an unrelated category leaves a result attached and the
"no results" placeholder unrendered -- the two failures above are the
same defect seen from either side.
Its sibling searchForEntityShouldWork already selects the category
before asserting presence (#30768). Apply the same scoping here and pass
the category from both call sites, so the negative assertion is made
against the category under test rather than the whole index.
Note this is not a port of #30768: that change is already on 1.13, and
it only touched the positive-case helper. The negative one was missed.
Co-Authored-By: Claude Opus 5 <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedScopes the SearchRBAC no-result assertion to its specific entity category to fix deterministic test failures caused by global search indexing. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
❌ UI Checkstyle Failed❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
Describe your changes:
Table Column > User without permissionfails deterministically on both 1.13 AUT runs, in two different ways that share one cause:Root cause
searchForEntityShouldWorkShowNoResultsearches globally, then asserts absence against whatever entity category Explore happens to be showing. A match from an unrelated category leaves a result attached and keeps the "no results" placeholder from rendering — so the two failures above are the same defect observed from either side.Its sibling
searchForEntityShouldWorkalready selects the category before asserting presence:The negative-case helper never got the same treatment.
Fix
Apply the same scoping to
searchForEntityShouldWorkShowNoResultand pass the category from both call sites (entity.nameand'Columns', matching what the positive helper is already given). The absence assertion is then made against the category under test rather than the whole index.This is not a port of #30768
Worth stating plainly, since that was the obvious assumption: #30768's change is already on 1.13.
searchForEntityShouldWorkhere already takesentityNameand clicks the category, and both call sites already pass it. #30768 only touched the positive-case helper; the negative one was missed on every branch. So there is nothing to backport — this is the missing half.Type of change:
Tests:
tscclean — which also confirms both call sites were updated, since the new parameter is required.One thing a reviewer with an environment should sanity-check: that the entity-category menu item renders even when the scoped category has zero results for this user. The positive helper only ever clicks it when results exist. If Explore hides empty categories, this needs the click guarded instead — I'd rather that be verified than assumed.
Also on this branch
The same unscoped-search shape exists on
mainand2.0, whereTable Column > User with permissionflakes. Worth the same fix there once this is confirmed.🤖 Generated with Claude Code
Greptile Summary
The PR updates the negative SearchRBAC helper to select the requested entity category before checking that a permission-restricted entity and the category’s results are absent.
searchForEntityShouldWorkShowNoResult.Confidence Score: 5/5
The PR appears safe to merge based on the accepted review findings, with no unacknowledged actionable defect remaining.
The helper signature and both repository call sites are consistent, and the only concrete failure mechanism identified is already expressly documented by the author as requiring environment validation.
Important Files Changed
Reviews (1): Last reviewed commit: "test(playwright): scope the SearchRBAC n..." | Re-trigger Greptile