@jjordy/swr-devtools
Version:
Devtools for SWR
15 lines (14 loc) • 695 B
JavaScript
import React from "react";
import KeysComponent from ".";
import { describe, test, expect } from "@jest/globals";
import { render, screen } from "../../test-utils";
import "fake-indexeddb/auto";
const keys = ['https://test.com/test/1', 'https://test.com/test/2'];
describe("SWR Devtools", () => {
test("Should render a component", async () => {
expect.assertions(1);
await render(React.createElement(KeysComponent, { keys: keys, selectedKey: "https://test.com/test/1", onSelect: () => { }, onClear: () => { }, onRevalidate: () => { }, theme: "Dark" }));
const title = await screen.getByText("Cache Keys");
expect(title).toBe(title);
});
});