Created
March 1, 2021 10:19
-
-
Save EileenJuergens/7ba52e40f8f933d44a2d8e2c0b2c5841 to your computer and use it in GitHub Desktop.
KPICard test setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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