Added coverage

This commit is contained in:
Federico Kereki
2018-09-16 16:07:52 -03:00
parent 22b5414686
commit 5158edc352
2 changed files with 12 additions and 19 deletions
+1
View File
@@ -28,6 +28,7 @@
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest",
"coverage": "jest --coverage --no-cache",
"flow": "flow",
"addTypes": "flow-typed install"
},
@@ -8,20 +8,19 @@ import { RegionsTable } from "./regionsTable.component";
Enzyme.configure({ adapter: new Adapter() });
const fakeDeviceData = {
isTablet: false,
isPortrait: true,
height: 1000,
width: 720,
scale: 1,
fontScale: 1
};
describe("RegionsTable", () => {
it("renders correctly an empty list", () => {
const wrapper = Enzyme.shallow(
<RegionsTable
deviceData={{
isTablet: false,
isPortrait: true,
height: 1000,
width: 720,
scale: 1,
fontScale: 1
}}
list={[]}
/>
<RegionsTable deviceData={fakeDeviceData} list={[]} />
);
expect(wrapper.contains("No regions."));
});
@@ -29,14 +28,7 @@ describe("RegionsTable", () => {
it("renders correctly a list", () => {
const wrapper = Enzyme.shallow(
<RegionsTable
deviceData={{
isTablet: false,
isPortrait: true,
height: 1000,
width: 720,
scale: 1,
fontScale: 1
}}
deviceData={fakeDeviceData}
list={[
{
countryCode: "UY",