-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Saw this failures in multiple PRs and also failed locally. Seems related to one merged PR #10572
FAIL src/plugins/explore/public/application/utils/state_management/utils/redux_persistence.test.ts
redux_persistence
persistReduxState
✓ should persist query and app state to URL storage (2 ms)
✓ should handle missing osdUrlStateStorage gracefully (1 ms)
✓ should handle errors gracefully
loadReduxState
✓ should load state from URL storage when available (2 ms)
✓ should fallback to preloaded state when URL storage is not available (1 ms)
✓ should use preloaded state for missing sections (1 ms)
✓ should handle errors and fallback to preloaded state
getPreloadedState
✓ should return complete preloaded state with correct UI defaults (2 ms)
✓ should handle dataset initialization
✓ should handle missing dataset service gracefully (1 ms)
✓ should use default columns from uiSettings
✓ should fallback to default columns when uiSettings is not available (1 ms)
✓ should set correct editor mode from DEFAULT_EDITOR_MODE
✓ should initialize meta state with isInitialized false
loadReduxState with meta state
✓ should use preloaded meta state when not provided in URL (1 ms)
✓ should use meta state from URL when provided
getPreloadedMetaState
✓ should return meta state with isInitialized false
✓ should always initialize meta state consistently (1 ms)
SignalType filtering
✓ should accept Traces datasets for Traces flavor
✓ should reject non-Traces datasets for Traces flavor (1 ms)
✓ should accept non-Traces datasets for non-Traces flavor
✓ should reject Traces datasets for non-Traces flavor
loadReduxState with SignalType validation for URL datasets
✕ should validate URL dataset against current flavor and use it if compatible (1 ms)
✕ should reject incompatible URL dataset and fetch new one for traces flavor (1 ms)
✕ should reject traces dataset for logs flavor and fetch compatible one (1 ms)
✕ should handle URL dataset validation errors gracefully (1 ms)
● redux_persistence › loadReduxState with SignalType validation for URL datasets › should validate URL dataset against current flavor and use it if compatible
ReferenceError: SignalType is not defined
600 | id: 'logs-dataset',
601 | title: 'Logs Dataset',
> 602 | signalType: SignalType.LOGS,
| ^
603 | });
604 |
605 | const result = await loadReduxState(mockServices);
at Object.<anonymous> (src/plugins/explore/public/application/utils/state_management/utils/redux_persistence.test.ts:602:21)
● redux_persistence › loadReduxState with SignalType validation for URL datasets › should reject incompatible URL dataset and fetch new one for traces flavor
ReferenceError: SignalType is not defined
637 | id: 'logs-dataset',
638 | title: 'Logs Dataset',
> 639 | signalType: SignalType.LOGS,
| ^
640 | });
641 |
642 | // Mock dataset service to return a traces dataset
at Object.<anonymous> (src/plugins/explore/public/application/utils/state_management/utils/redux_persistence.test.ts:639:21)
● redux_persistence › loadReduxState with SignalType validation for URL datasets › should reject traces dataset for logs flavor and fetch compatible one
expect(received).toEqual(expected) // deep equality
Expected: {"dataSource": undefined, "id": "logs-dataset", "timeFieldName": undefined, "title": "Logs Dataset", "type": "INDEX_PATTERN"}
Received: undefined
713 |
714 | // Should NOT use the traces dataset, should fetch a logs-compatible one
> 715 | expect(result.query.dataset).toEqual({
| ^
716 | id: 'logs-dataset',
717 | title: 'Logs Dataset',
718 | type: 'INDEX_PATTERN',
at Object.<anonymous> (src/plugins/explore/public/application/utils/state_management/utils/redux_persistence.test.ts:715:36)
● redux_persistence › loadReduxState with SignalType validation for URL datasets › should handle URL dataset validation errors gracefully
expect(received).toEqual(expected) // deep equality
Expected: {"dataSource": undefined, "id": "fallback-dataset", "timeFieldName": undefined, "title": "Fallback Dataset", "type": "INDEX_PATTERN"}
Received: undefined
759 |
760 | // Should fall back to fetching a new dataset when validation fails
> 761 | expect(result.query.dataset).toEqual({
| ^
762 | id: 'fallback-dataset',
763 | title: 'Fallback Dataset',
764 | type: 'INDEX_PATTERN',
at Object.<anonymous> (src/plugins/explore/public/application/utils/state_management/utils/redux_persistence.test.ts:761:36)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 4 failed, 23 passed, 27 total
Snapshots: 0 total
Time: 4.369 s
Ran all test suites matching /yarn|test:jest|src\/plugins\/explore\/public\/application\/utils\/state_management\/utils\/redux_persistence.test.ts/i.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Metadata
Metadata
Assignees
Labels
No labels