-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return empty houses and axes when not has position
- Loading branch information
Showing
7 changed files
with
95 additions
and
52 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
39 changes: 39 additions & 0 deletions
39
test/features/empty-houses-and-axes-when-not-send-geoposition.test.js
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 request = require("supertest"); | ||
const app = require("./../../app"); | ||
|
||
describe("Get houses empty and axes as undefined when geolocation is not send", () => { | ||
let response; | ||
|
||
beforeEach(async () => { | ||
response = await request(app) | ||
.get("/horoscope") | ||
.query({ | ||
time: "1991-07-06T16:50:00-04:00", | ||
}) | ||
.send(); | ||
}); | ||
|
||
it("/horoscope return the AC axis (cuspid of the house I) equal to undefined", () => { | ||
expect(response.body.data.axes.asc).toBeUndefined(); | ||
}); | ||
|
||
it("/horoscope return the DC axis (cuspid of the house VII) equal to undefined", () => { | ||
expect(response.body.data.axes.dc).toBeUndefined(); | ||
}); | ||
|
||
it("/horoscope return the IC axis (cuspid of the house IV) equal to undefined", () => { | ||
expect(response.body.data.axes.ic).toBeUndefined(); | ||
}); | ||
|
||
it("/horoscope return the MC axis (cuspid of the house X) equal to undefined", () => { | ||
expect(response.body.data.axes.mc).toBeUndefined(); | ||
}); | ||
|
||
it("/horoscope return the MC axis (cuspid of the house X) equal to undefined", () => { | ||
expect(response.body.data.axes.mc).toBeUndefined(); | ||
}); | ||
|
||
it("/horoscope return the houses elements empty", () => { | ||
expect(response.body.data.houses.length).toBe(0); | ||
}); | ||
}); |
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,11 @@ | ||
const { degreesToDms } = require("./../../src/astrologer/utils"); | ||
|
||
describe("Transform longitude degrees to dms", () => { | ||
it("transform 270 to 270º0'0\"", () => { | ||
const result = degreesToDms(270); | ||
expect(result.degrees).toBe(0); | ||
expect(result.longitude).toBe(270); | ||
expect(result.minutes).toBe(0); | ||
expect(result.seconds).toBe(0); | ||
}); | ||
}); |