bito-code-review[bot] commented on PR #40146:
URL: https://github.com/apache/superset/pull/40146#issuecomment-5081431580
<!-- Bito Reply -->
The flagged issue is correct. Using `toContain` only verifies that each
expected series name exists at least once, which allows for potential
regressions where duplicate series are emitted. To ensure each metric/dimension
combination appears exactly once, you should assert the length of the filtered
series array and verify the count of each expected name.
To resolve this, you can update the test to count occurrences:
```typescript
// Instead of just toContain, verify the exact count
expect(queryASeriesNames).toHaveLength(4);
expect(queryASeriesNames.filter(n => n === 'score_one,
A')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_one,
B')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_two,
A')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_two,
B')).toHaveLength(1);
```
There are no other comments on this PR to address. Would you like me to
implement this change for you?
**superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts**
```
expect(queryASeriesNames).toHaveLength(4);
expect(queryASeriesNames.filter(n => n === 'score_one,
A')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_one,
B')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_two,
A')).toHaveLength(1);
expect(queryASeriesNames.filter(n => n === 'score_two,
B')).toHaveLength(1);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]