fix(tests): fix eslint warnings

This commit is contained in:
Łukasz Mierzwa
2020-10-27 18:42:59 +00:00
committed by Łukasz Mierzwa
parent 836cf67fe8
commit cdb984bf20
3 changed files with 13 additions and 4 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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,