mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-12 07:05:56 -07:00
81accd8dbe
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com>
14 lines
410 B
React
14 lines
410 B
React
import { render } from "@testing-library/react";
|
|
|
|
import { SettingsContext } from "utils/contexts/settings";
|
|
|
|
export function renderWithProviders(ui, { settings = {} } = {}) {
|
|
const value = {
|
|
settings,
|
|
// Most tests don't need to mutate settings; this keeps Container happy.
|
|
setSettings: () => {},
|
|
};
|
|
|
|
return render(<SettingsContext.Provider value={value}>{ui}</SettingsContext.Provider>);
|
|
}
|