Skip to content

test(e2e): cover the Designer dialog, export, reset and node collapsing - #122

Merged
gesinn-it-gea merged 1 commit into
mainfrom
test/e2e-designer
Nov 11, 2026
Merged

gesinn-it-gea merged 1 commit into
mainfrom
test/e2e-designer

Conversation

@gesinn-it-gea

Copy link
Copy Markdown
Member

Follow-up to #120, which listed these as not covered: the Designer dialogs and the effect of a click.

New tests

  • Add node dialog: adding Alice with the property Knows through the dialog results in 3 nodes and 3 edges and closes the dialog.
  • Export wikitext: the visible graph is copied to the clipboard as {{#knowledgegraph: wikitext with the expected nodes and properties.
  • Click collapses neighbors: a click on a node hides its neighbors and their edges, a second click shows them again. The old test only asserted that no error occurs. It uses a second seeded page with depth=1, because neighbors that were loaded as nodes themselves are not toggled.
  • Reset graph: after Reset graph (a native confirm(), accepted in the test) a new network exists, the hook fired again and the graph is empty. After adding a node again, the context menu and double-click work on the new network (regression guard for bug (designer): "Reset graph" drops the click, hover and double-click handlers of the network #110).

Verification

  • 11 tests pass against vis-network 9.1.13 and 10.1.4 on a freshly installed MediaWiki 1.43 / SMW 7.2.0 test wiki, set up the same way as in CI (port published through build/docker-compose.override.yml).
  • 88 consecutive runs (8 x 11) without a failure.
  • With DataSet#update disabled in the served bundle only the collapse test fails. With Network#on disabled six tests fail, including the Reset graph one.
  • A first version of the dialog helper failed in the second dialog of a test: options of a closed dialog stay in the DOM and .first() picked a hidden one. It now only looks at visible options of the active dialog.

Not covered

Node deletion and editing through the dialog, the "By properties" and "By categories" tabs, and the graph configuration panel.

The browser tests only checked that the Designer page loads and that a click
on a node causes no error. Add tests for what users actually do with the
library: add an article through the Add node dialog, export the visible graph
as wikitext, collapse and expand the neighbors of a node by clicking it, and
use the graph after Reset graph, which creates a new network whose handlers
have to be bound again.

Group the Designer tests and share the dialog steps in a helper that only
looks at visible options of the active dialog, because options of a dialog
opened earlier stay in the DOM.
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.68%. Comparing base (4a15b15) to head (8bf2047).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #122   +/-   ##
=========================================
  Coverage     80.68%   80.68%           
  Complexity      186      186           
=========================================
  Files            18       18           
  Lines          1807     1807           
  Branches        216      216           
=========================================
  Hits           1458     1458           
  Misses          197      197           
  Partials        152      152           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gesinn-it-gea
gesinn-it-gea merged commit b8ff402 into main Nov 11, 2026
6 checks passed
@gesinn-it-gea
gesinn-it-gea deleted the test/e2e-designer branch November 11, 2026 11:18
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.

1 participant