Skip to content

Instantly share code, notes, and snippets.

@EileenJuergens
Created March 1, 2021 10:19
Show Gist options
  • Save EileenJuergens/7ba52e40f8f933d44a2d8e2c0b2c5841 to your computer and use it in GitHub Desktop.
Save EileenJuergens/7ba52e40f8f933d44a2d8e2c0b2c5841 to your computer and use it in GitHub Desktop.
KPICard test setup
import React from "react";
import { Context as ResponsiveContext } from "react-responsive";
import { mount } from "enzyme";
import KPICard from "./kpi-card.js";
import Icon from "./icon.js";
import IncomeSolid from "./icome-soild.svg";
const optionsMobile = {
wrappingComponent: ResponsiveContext.Provider,
wrappingComponentProps: { value: { width: 550 } }
};
const optionsWeb = {
wrappingComponent: ResponsiveContext.Provider,
wrappingComponentProps: { value: { width: 1550 } }
};
let mountedComponentMobile;
let mountedComponentWeb;
const mountComponentMobile = (props = {}) => mount(<KPICard {...props} />, optionsMobile);
const mountComponentWeb = (props = {}) => mount(<KPICard {...props} />, optionsWeb);
const mockedProps = {
title: "Income",
value: "103.82k £",
icon: IncomeSolid
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment