Skip to content

Avoid snapshot in metaspaces order test#34183

Open
dbkr wants to merge 5 commits into
developfrom
dbkr/metaspaces_test
Open

Avoid snapshot in metaspaces order test#34183
dbkr wants to merge 5 commits into
developfrom
dbkr/metaspaces_test

Conversation

@dbkr

@dbkr dbkr commented Jul 8, 2026

Copy link
Copy Markdown
Member

Just assert the thing we're actually testing rather than a snapshot because I keep having to update this snapshot every time anything in the left panel changes and it's tedious.

Checklist

Just assert the thing we're actually testing rather than a snapshot
because I keep having to update this snapshot every time anything in
the left panel changes and it's tedious.
@dbkr dbkr added the T-Task Tasks for the team like planning label Jul 8, 2026
const { container } = render(<SpacePanel />);

// Inspect the order of the rendered MetaSpaces, excluding the "Create a space" button.
const metaSpaceLabels = Array.from(container.querySelectorAll(".mx_SpaceButton:not(.mx_SpaceButton_new)")).map(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use instead an accessible attribute to query or a test id attribute instead of relying on the class?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get all the button roles like so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants