mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-12 22:44:14 +00:00
Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
22 lines
624 B
TypeScript
22 lines
624 B
TypeScript
import { beforeEach, describe, expect, it } from "vitest";
|
|
|
|
import { useComplianceWatchlistViewStore } from "@/store/compliance/store";
|
|
|
|
describe("useComplianceWatchlistViewStore", () => {
|
|
beforeEach(() => {
|
|
localStorage.clear();
|
|
useComplianceWatchlistViewStore.setState({ showOnlyWatchlist: false });
|
|
});
|
|
|
|
it("persists only the filter value", () => {
|
|
// When
|
|
useComplianceWatchlistViewStore.getState().setShowOnlyWatchlist(true);
|
|
|
|
// Then
|
|
expect(
|
|
JSON.parse(localStorage.getItem("compliance-watchlist-view") ?? "{}")
|
|
.state,
|
|
).toEqual({ showOnlyWatchlist: true });
|
|
});
|
|
});
|