Added coverage
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
"android": "react-native-scripts android",
|
"android": "react-native-scripts android",
|
||||||
"ios": "react-native-scripts ios",
|
"ios": "react-native-scripts ios",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
|
"coverage": "jest --coverage --no-cache",
|
||||||
"flow": "flow",
|
"flow": "flow",
|
||||||
"addTypes": "flow-typed install"
|
"addTypes": "flow-typed install"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,20 +8,19 @@ import { RegionsTable } from "./regionsTable.component";
|
|||||||
|
|
||||||
Enzyme.configure({ adapter: new Adapter() });
|
Enzyme.configure({ adapter: new Adapter() });
|
||||||
|
|
||||||
|
const fakeDeviceData = {
|
||||||
|
isTablet: false,
|
||||||
|
isPortrait: true,
|
||||||
|
height: 1000,
|
||||||
|
width: 720,
|
||||||
|
scale: 1,
|
||||||
|
fontScale: 1
|
||||||
|
};
|
||||||
|
|
||||||
describe("RegionsTable", () => {
|
describe("RegionsTable", () => {
|
||||||
it("renders correctly an empty list", () => {
|
it("renders correctly an empty list", () => {
|
||||||
const wrapper = Enzyme.shallow(
|
const wrapper = Enzyme.shallow(
|
||||||
<RegionsTable
|
<RegionsTable deviceData={fakeDeviceData} list={[]} />
|
||||||
deviceData={{
|
|
||||||
isTablet: false,
|
|
||||||
isPortrait: true,
|
|
||||||
height: 1000,
|
|
||||||
width: 720,
|
|
||||||
scale: 1,
|
|
||||||
fontScale: 1
|
|
||||||
}}
|
|
||||||
list={[]}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
expect(wrapper.contains("No regions."));
|
expect(wrapper.contains("No regions."));
|
||||||
});
|
});
|
||||||
@@ -29,14 +28,7 @@ describe("RegionsTable", () => {
|
|||||||
it("renders correctly a list", () => {
|
it("renders correctly a list", () => {
|
||||||
const wrapper = Enzyme.shallow(
|
const wrapper = Enzyme.shallow(
|
||||||
<RegionsTable
|
<RegionsTable
|
||||||
deviceData={{
|
deviceData={fakeDeviceData}
|
||||||
isTablet: false,
|
|
||||||
isPortrait: true,
|
|
||||||
height: 1000,
|
|
||||||
width: 720,
|
|
||||||
scale: 1,
|
|
||||||
fontScale: 1
|
|
||||||
}}
|
|
||||||
list={[
|
list={[
|
||||||
{
|
{
|
||||||
countryCode: "UY",
|
countryCode: "UY",
|
||||||
|
|||||||
Reference in New Issue
Block a user