8000 fix: refresh badge links when selected result changes by Tambosa · Pull Request #818 · gemini-testing/html-reporter · GitHub
[go: up one dir, main page]

Skip to content

fix: refresh badge links when selected result changes - #818

Open
Tambosa wants to merge 1 commit into
gemini-testing:masterfrom
Tambosa:fix/stale-badge-links-817
Open

Tambosa wants to merge 1 commit into
gemini-testing:masterfrom
Tambosa:fix/stale-badge-links-817

Conversation

@Tambosa
@Tambosa Tambosa commented Oct 16, 2026
Copy link
Copy Markdown

Badge links can retain the previous result's URLs when switching results without changing the page URL or base host. Include suite.attachments in the TestStatusBar memo dependencies so the badges update with the selected result.

Add a regression test that switches A → B → A and then selects a result without badges. It verifies both URL updates and removal of stale badges. The test fails on the original implementation and passes with this fix.

Closes #817.

Validation

  • npm test: lint, 711 Node unit tests, 854 jsdom unit tests, and type checks passed on Node.js 20.20.2.
  • npm run build:client: passed.
  • Built-client browser check using the standalone reproduction: A → B → A updates the badge URL correctly without reloading.

Docker-based E2E and component browser suites were not run locally.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en.

@sipayRT sipayRT left a comment
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.

lgtm


expect(component.getByRole('link', {name: 'External link'}).getAttribute('href')).to.equal('https://example.com/a');

for (const id of ['b', 'a', 'empty']) {
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.

you don't need to check b → a here — you have already checked a state above. So in this case you can simplify this part to something like:

const selectResult = (id: string): void => {
    act(() => {
        store.dispatch(setCurrentTreeNode({browserId: id, treeNodeId: id}));
    });
};

selectResult('b');
expect(component.getByRole('link', {name: 'External link'})).to.have.attribute('href', 'https://example.com/b');

selectResult('empty');
expect(component.queryByText('External link')).to.not.exist;

@pkg-pr-new
pkg-pr-new Bot commented Oct 20, 2026
Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/html-reporter@818

commit: 8d4e619

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New UI: badge links remain stale when switching between test results

2 participants

0