-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add supercheck, supercheck-travis, and bleach to package.json rename files to corresponding USs #31
- Loading branch information
1 parent
ccd3144
commit 1b33045
Showing
12 changed files
with
21,787 additions
and
62 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,60 @@ | ||
import CustomMarker from "../src/components/map-overlays/custom-marker.component"; | ||
import { Buildings } from "../src/constants/buildings.data"; | ||
import { BuildingId } from "../src/types/main"; | ||
import renderer from "react-test-renderer"; | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
import { BUILDING_MARKER_COLOR, CONCORDIA_RED } from "../src/constants/style"; | ||
import { POIInfo } from "../src/constants/poi.data"; | ||
import { BUILDING_MARKER_COLOR } from "../src/constants/style"; | ||
|
||
describe("CustomMarker component", () => { | ||
const buildingH = Buildings[0]; | ||
const H = BuildingId[BuildingId.H]; | ||
|
||
it("should match snapshot", () => { | ||
const tree = renderer.create(<CustomMarker />).toJSON(); | ||
const building = Buildings[0]; | ||
const tree = renderer | ||
.create( | ||
<CustomMarker | ||
location={building.location} | ||
markerType={"building"} | ||
text={"asdf"} | ||
onPress={null} | ||
/> | ||
) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it("should run provided function on press", () => { | ||
const mockOnPress = jest.fn(); | ||
const building = Buildings[0]; | ||
const wrapper = shallow( | ||
<CustomMarker | ||
location={buildingH.location} | ||
markerType={"building"} | ||
text={H} | ||
location={building.location} | ||
markerType={"poi"} | ||
text={"asdf"} | ||
onPress={mockOnPress} | ||
testID={"marker" + H} | ||
/> | ||
); | ||
const marker = wrapper.find({ testID: "marker" + H }); | ||
const marker = wrapper.find({ testID: "marker" }); | ||
marker.simulate("press"); | ||
expect(mockOnPress).toHaveBeenCalledTimes(1); | ||
}); | ||
|
||
it("should be black if it is a building marker", () => { | ||
const building = Buildings[0]; | ||
const wrapper = shallow( | ||
<CustomMarker | ||
location={buildingH.location} | ||
location={building.location} | ||
markerType={"building"} | ||
text={H} | ||
text={"asdf"} | ||
onPress={() => {}} | ||
testID={"marker" + H} | ||
/> | ||
); | ||
|
||
const bubble = wrapper.find({ testID: "marker" + H + "Bubble" }).props(); | ||
const bubble = wrapper | ||
.find({ testID: "bubble" }) | ||
.at(0) | ||
.props(); | ||
expect(bubble).toHaveProperty( | ||
["style", "backgroundColor"], | ||
BUILDING_MARKER_COLOR | ||
); | ||
}); | ||
|
||
it("should be red if it is a poi marker", () => { | ||
const H801 = POIInfo[9]; | ||
const wrapper = shallow( | ||
<CustomMarker | ||
location={buildingH.location} | ||
markerType={"poi"} | ||
text={H801.displayName} | ||
onPress={() => {}} | ||
testID={"poi" + H801.id} | ||
/> | ||
); | ||
|
||
const bubble = wrapper.find({ testID: "poi" + H801.id + "Bubble" }).props(); | ||
expect(bubble).toHaveProperty(["style", "backgroundColor"], CONCORDIA_RED); | ||
}); | ||
}); |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const { reloadApp } = require("detox-expo-helpers"); | ||
import { by, device, expect, element, waitFor } from 'detox'; | ||
|
||
beforeAll(async () => { | ||
await reloadApp(); | ||
}); | ||
|
||
describe("US-4: Additional campus building information", () => { | ||
it("should show minimal building information", async () => { | ||
// await element(by.id("mapView")).pinchWithAngle("outward", "slow", 0); | ||
// await console.log("pinched and zoomed into mapView"); | ||
|
||
// await element(by.id("mapView")).swipe("down", "slow", 0.70); | ||
// await console.log("swiped down"); | ||
// await element(by.id("mapView")).swipe("right", "slow", 0.50); | ||
// await console.log("swiped right"); | ||
|
||
await element(by.id("mapView")).tapAtPoint({ x: 154, y: 308 }); | ||
await waitFor(element(by.id("panel"))).toExist().withTimeout(2000); | ||
|
||
await expect(element(by.id("panelDisplayName"))).toBeVisible(); | ||
await expect(element(by.id("panelAddress"))).toBeVisible(); | ||
|
||
await element(by.id("panelCloseButton")).tap(); | ||
}); | ||
|
||
it("should show extensive building information", async () => { | ||
await element(by.id("mapView")).tapAtPoint({ x: 154, y: 308 }); | ||
await waitFor(element(by.id("panel"))).toExist().withTimeout(2000); | ||
|
||
await element(by.id("panelDisplayName")).swipe("up", "fast", 0.50); | ||
await expect(element(by.id("scrollDepartments"))).toBeVisible(); | ||
await element(by.id("scrollDepartments")).swipe("up", "fast", 0.50); | ||
await expect(element(by.id("scrollServices"))).toBeVisible(); | ||
await element(by.id("panelDisplayName")).swipe("down", "fast", 0.50); | ||
|
||
await element(by.id("panelCloseButton")).tap(); | ||
}); | ||
}); |
Oops, something went wrong.