test: add e2e test for relationships tab feature - #2500
Open
omkar-ethz wants to merge 4 commits into
Open
Conversation
omkar-ethz
marked this pull request as ready for review
August 13, 2026 12:06
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The Cypress selectors for dataset rows (e.g.
.dataset-table mat-row) are fairly brittle; consider adding dedicateddata-cyattributes for the dataset table/rows similar to the new tab nav selector to make the tests less sensitive to DOM/layout changes. - The
stubFrontendConfighelper is only called within individual tests; to avoid future tests accidentally relying on cached/admin/configresponses, consider moving a default stub intobeforeEachand letting tests override specific options when needed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Cypress selectors for dataset rows (e.g. `.dataset-table mat-row`) are fairly brittle; consider adding dedicated `data-cy` attributes for the dataset table/rows similar to the new tab nav selector to make the tests less sensitive to DOM/layout changes.
- The `stubFrontendConfig` helper is only called within individual tests; to avoid future tests accidentally relying on cached `/admin/config` responses, consider moving a default stub into `beforeEach` and letting tests override specific options when needed.
## Individual Comments
### Comment 1
<location path="cypress/e2e/datasets/datasets-relationships.cy.js" line_range="51-56" />
<code_context>
+ .contains("Relationships")
+ .click();
+ relationships.relationships.forEach((r, i) => {
+ const vals = [
+ r.identifierType == "URL" && r.externalId ? r.externalId : r.identifier,
+ r.entityType,
+ r.identifierType,
+ ];
+ Object.values(vals).forEach((v) => cy.get("mat-row").eq(i).contains(v));
+ });
+ });
</code_context>
<issue_to_address>
**suggestion:** Equality checks and the use of `Object.values` here could be simplified and made more robust.
Since `vals` is already an array, `Object.values(vals)` is unnecessary; iterate over `vals` directly for clarity. Also, prefer `===` over `==` for the `identifierType` comparison to avoid implicit type coercion. For example:
```js
const vals = [
r.identifierType === "URL" && r.externalId ? r.externalId : r.identifier,
r.entityType,
r.identifierType,
];
vals.forEach((v) => cy.get("mat-row").eq(i).contains(v));
```
Suggested implementation:
```javascript
cy.get("[data-cy=dataset-dashboard-tabs]")
.contains("Relationships")
.click();
relationships.relationships.forEach((r, i) => {
const vals = [
r.identifierType === "URL" && r.externalId ? r.externalId : r.identifier,
r.entityType,
r.identifierType,
];
vals.forEach((v) => cy.get("mat-row").eq(i).contains(v));
});
```
The replacement assumes that the body of the `relationships.relationships.forEach` loop was previously empty or only contained assertions related to table cell values. If there are additional assertions or logic inside this loop elsewhere in the file, they should be preserved and placed after the `vals.forEach(...)` call to maintain the existing test behavior.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adding Cypress tests for the Relationships tab feature introduced in #2416
Feature under test:

Motivation
#2416 (review)
Fixes:
Please provide a list of the fixes implemented in this PR
Changes:
Please provide a list of the changes implemented by this PR
Tests included
Documentation
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Add end-to-end coverage for the dataset relationships tab behavior in the datasets dashboard.
Enhancements:
Tests:
Summary by Sourcery
Add end-to-end test coverage for the dataset relationships tab behavior and wire it with a stable UI test selector.
Enhancements:
Tests: