Open Vladimir-Kokin opened 2 years ago
A test of component which used videx-wellog library craches inside D3 library code The test (https://github.com/equinor/webviz-subsurface-components/pull/776) is written for Jest environment
FAIL src/lib/components/WellLogViewer/WellLogViewer.test.tsx ● Test Well Log Viewer Component › snapshot test TypeError: name.toLowerCase is not a function 366 | logController.scaleHandler = scaleHandler; 367 | logController.domain = minmaxPrimaryAxis; > 368 | logController.setTracks(tracks); | ^ 369 | } 370 | 371 | function addTrackMouseEventListner(
This error is due to a BUG in videx-wellog (file log-controller.ts, function _trackEnter):
if (showLegend) { newtracks.append('div') .classed('track-legend', true) .classed('hidden', legendHeight <= 0) .style([attr.size], `${legendHeight}px`);
The last line should reads (without square brackets! because the first parameter should be a string not an array of strings):
.style(attr.size, `${legendHeight}px`);
The same bug is in function _trackUpdate
if (showLegend) { const legend = selection.select('.track-legend'); legend .style([sizeAttr], `${legendHeight}px`)
It is unclear why these bugs leads to crash only in test environment
See also https://github.com/equinor/webviz-subsurface-components/issues/803
Nice catch, mind making a pull request to fix this?
A test of component which used videx-wellog library craches inside D3 library code The test (https://github.com/equinor/webviz-subsurface-components/pull/776) is written for Jest environment
This error is due to a BUG in videx-wellog (file log-controller.ts, function _trackEnter):
The last line should reads (without square brackets! because the first parameter should be a string not an array of strings):
The same bug is in function _trackUpdate
It is unclear why these bugs leads to crash only in test environment
See also https://github.com/equinor/webviz-subsurface-components/issues/803