Skip to content

Add unit and browser tests for network map layers, upgrade deck.gl to 9.3#380

Open
amarant wants to merge 12 commits into
mainfrom
network-layers-tests-sq
Open

Add unit and browser tests for network map layers, upgrade deck.gl to 9.3#380
amarant wants to merge 12 commits into
mainfrom
network-layers-tests-sq

Conversation

@amarant

@amarant amarant commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
  • Implemented tests for ArrowLayer, ForkLineLayer, ParallelPathLayer, ScatterplotLayerExt, and LineLayer.
  • Added screenshot comparison functionality for visual regression testing.
  • Created utility functions for rendering layers and setting up test environments.
  • Introduced network and geo data creation functions for testing purposes.
  • Added browser setup entrypoint for package-level shared initialization.
  • Updated App.tsx to utilize large network and geo data for testing.
  • Added new test cases for arrow, fork, parallel path, and scatterplot layers to handle large network scenarios.
  • Introduced large network and geo data creation functions in network-fixtures.ts.
  • Adjusted browser rendering setup to accommodate larger viewport sizes.
  • Enhanced logging for current view state in network-map.tsx.
  • Updated Vitest configuration for increased viewport dimensions in tests.
  • Updated @deck.gl and @luma.gl dependencies to 9.3.0 versions in package.json and network-map-layers/package.json.
  • Add Playwright installation step to CI build process
  • Add upload step for browser failure screenshots in CI workflows
  • Add image approximate comparison in tests
  • Add sonar ignore for test fixtures
  • Refactor LineLayer deprecated coordinate system enum to use string literals

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

What kind of change does this PR introduce?

Add tests for map layers

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

@amarant
amarant force-pushed the network-layers-tests-sq branch 11 times, most recently from a02f594 to 89dacb4 Compare April 21, 2026 13:35
@amarant amarant changed the title Add unit and browser tests for network map layers Add unit and browser tests for network map layers, upgrade deck.gl to 9.3 Apr 21, 2026
@amarant
amarant force-pushed the network-layers-tests-sq branch from 89dacb4 to 795929f Compare April 21, 2026 13:46
@amarant
amarant force-pushed the network-layers-tests-sq branch 3 times, most recently from 8d18d04 to a360f24 Compare May 11, 2026 11:49
@amarant
amarant force-pushed the network-layers-tests-sq branch from a360f24 to 0f8ea52 Compare May 19, 2026 08:58
@sonarqubecloud

Copy link
Copy Markdown

@rolnico
rolnico requested review from rolnico and sBouzols May 22, 2026 11:55
@amarant
amarant force-pushed the network-layers-tests-sq branch 7 times, most recently from ba7fff3 to 67e26d9 Compare June 18, 2026 11:45
amarant added 3 commits June 30, 2026 10:19
- Implemented tests for ArrowLayer, ForkLineLayer, ParallelPathLayer, ScatterplotLayerExt, and LineLayer.
- Added screenshot comparison functionality for visual regression testing.
- Created utility functions for rendering layers and setting up test environments.
- Introduced network and geo data creation functions for testing purposes.
- Added browser setup entrypoint for package-level shared initialization.
- Updated App.tsx to utilize large network and geo data for testing.
- Added new test cases for arrow, fork, parallel path, and scatterplot layers to handle large network scenarios.
- Introduced large network and geo data creation functions in network-fixtures.ts.
- Adjusted browser rendering setup to accommodate larger viewport sizes.
- Enhanced logging for current view state in network-map.tsx.
- Updated Vitest configuration for increased viewport dimensions in tests.
- Updated @deck.gl and @luma.gl dependencies to 9.3.0 versions in package.json and network-map-layers/package.json.

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
add image approximate comparison in tests
sonar ignore test fixtures

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
amarant added 4 commits June 30, 2026 10:19
Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
…right browser installation step

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
@amarant
amarant force-pushed the network-layers-tests-sq branch from 67e26d9 to 3a4a14c Compare June 30, 2026 08:19
Comment thread sonar-project.properties Outdated

@sBouzols sBouzols left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests OK in GridSuite app
Some minor comments

amarant added 2 commits July 6, 2026 14:51
…ility files

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
… and add missing configDefaults import

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>

@NathanDissoubray NathanDissoubray left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have 10 tests that lack assertions, as pointed out by Sonar, is there a reason for this ?

Comment thread demo/src/App.tsx
"@luma.gl/core": "~9.2.0",
"@luma.gl/engine": "~9.2.0",
"@luma.gl/shadertools": "~9.2.0"
"@deck.gl/core": "~9.3.0",

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.

Could you tell me if there is a reason why the versions are different (9.3.0 here and 9.3.4 below)?

@amarant amarant Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I synchronized the @powsybl/network-viewer package to ~9.3.0

@amarant

amarant commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

You have 10 tests that lack assertions, as pointed out by Sonar, is there a reason for this ?

@NathanDissoubray None of the tests lack assertions, it's just that sonar doesn't understand this is an assertion.

await expectElement(canvas).toMatchScreenshot(...)

So-Fras
So-Fras previously approved these changes Jul 10, 2026
…n 9.3.0

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
So-Fras
So-Fras previously approved these changes Jul 10, 2026
@NathanDissoubray

Copy link
Copy Markdown

@amarant there are sonar issues regarding using chains
image

I'm not sure what this means, but could you take a look at it ?

…access to properties

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
@NathanDissoubray
NathanDissoubray dismissed their stale review July 10, 2026 13:37

Concerns have been addressed

Comment thread eslint.config.js Outdated
parserOptions: {
projectService: true,
projectService: {
allowDefaultProject: ['./setupBrowserTests.ts'],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is this file setupBrowserTests.ts ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's a leftover of intermediate work, but browser tests didn't need a setup. I will remove it.

…rserOptions

Signed-off-by: Arnaud Marant <arnaud.marant@rte-france.com>
@sonarqubecloud

Copy link
Copy Markdown

@sBouzols

Copy link
Copy Markdown
Contributor

Could you separate this work into 3 different PRs please:

  • DeckGL upgrade to 9.3 and associated code adaptation if needed
  • Vitest upgrade to ^4.1.9 and associated code adaptation if needed
  • and the last one for vitest UI and Playwright adding and Github workflow adaptation

We think with @SlimaneAmar that it will be easier to follow and merge then.

@amarant

amarant commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@SlimaneAmar @sBouzols

Thanks for the suggestion. After reviewing the dependency relationships and the associated code changes, I am not sure splitting this work into three PRs would provide much additional value.
The DeckGL 9.3 upgrade is required because this version introduces the Vitest-specific layer harness used by the new tests:

import { testLayer } from '@deck.gl/test-utils/vitest';

This entry point does not exist in DeckGL 9.2. The only application-code adaptation associated with the DeckGL upgrade is a two-line coordinate-system update:

getProximityFactor(...) {
-    if (this.props.coordinateSystem === COORDINATE_SYSTEM.CARTESIAN) {
+    if (this.props.coordinateSystem === 'cartesian') {
         // Cartesian distance calculation
     }
}
computeAngle(...) {
-    if (props.coordinateSystem === COORDINATE_SYSTEM.CARTESIAN) {
+    if (props.coordinateSystem === 'cartesian') {
         // Cartesian angle calculation
     }
}

DeckGL 9.3 changes coordinate systems from numeric values to string values and recommends using the string constants directly. Apart from these two lines, the DeckGL bump is only there to make the new Vitest layer harness available.
The Vitest upgrade from 4.0.18 to 4.1.9 does not introduce or require any code change. It is simply a dependency bump to keep the testing tool and its related packages up to date:

- "@vitest/coverage-v8": "^4.0.18",
+ "@vitest/coverage-v8": "^4.1.9",
- "vitest": "^4.0.18"
+ "vitest": "^4.1.9"

The Playwright provider, browser configuration, screenshots, tests and workflow adaptations are all parts of the same browser-testing feature.

Consequently, splitting this into three PRs would result in:

  1. A dependency upgrade required by the tests, with only a two-line code adaptation.
  2. A dependency-only Vitest update with no code adaptation.
  3. The actual tests and CI changes that depend on those dependencies.

These would be stacked rather than independent PRs, and each would introduce overlapping package-lock.json changes. For that reason, I think keeping the changes together provides a more coherent and testable unit of work. If the main concern is the review size, a more meaningful split could be unit/lifecycle tests versus browser visual tests and CI.

If useful, I can also explain the dependency relationships and the rationale for keeping these changes together in person.

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.

4 participants