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