mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): fix eslint warnings
This commit is contained in:
committed by
Łukasz Mierzwa
parent
836cf67fe8
commit
cdb984bf20
@@ -8,7 +8,6 @@ import toDiffableHtml from "diffable-html";
|
||||
import { useFetchGetMock } from "__fixtures__/useFetchGet";
|
||||
import { AlertStore, NewUnappliedFilter } from "Stores/AlertStore";
|
||||
import { Settings } from "Stores/Settings";
|
||||
import { useFetchGet } from "Hooks/useFetchGet";
|
||||
import { FilterInput } from ".";
|
||||
|
||||
let alertStore: AlertStore;
|
||||
|
||||
@@ -86,7 +86,7 @@ const EmptyAPIResponse = (): APIAlertsResponseT => ({
|
||||
},
|
||||
});
|
||||
|
||||
const MockAPIResponse = () => {
|
||||
const MockAPIResponse = (): APIAlertsResponseT => {
|
||||
const response = EmptyAPIResponse();
|
||||
response.grids = [
|
||||
{
|
||||
@@ -112,7 +112,10 @@ const MockAPIResponse = () => {
|
||||
return response;
|
||||
};
|
||||
|
||||
const MockSilenceResponse = (cluster: string, count: number) => {
|
||||
const MockSilenceResponse = (
|
||||
cluster: string,
|
||||
count: number
|
||||
): APIManagedSilenceT[] => {
|
||||
const silences: APIManagedSilenceT[] = [];
|
||||
for (let index = 1; index <= count; index++) {
|
||||
const silence = MockSilence();
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
const mockMatchMedia = (mapOfMedia: any) => {
|
||||
interface mapOfMediaT {
|
||||
matches: boolean;
|
||||
media: string;
|
||||
}
|
||||
|
||||
const mockMatchMedia = (mapOfMedia: {
|
||||
[query: string]: mapOfMediaT;
|
||||
}): jest.MockedFunction<typeof window.matchMedia> => {
|
||||
return jest.fn().mockImplementation((query) => {
|
||||
return {
|
||||
matches: mapOfMedia[query] ? mapOfMedia[query].matches : false,
|
||||
|
||||
Reference in New Issue
Block a user