-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix Cypress and Jest tests, add Jest test [PT-188007060]
- Loading branch information
Showing
7 changed files
with
34 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'test-file-stub'; |
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,5 +1,5 @@ | ||
export const AppElements = { | ||
getApp() { | ||
return cy.get(".app"); | ||
return cy.get(".App"); | ||
} | ||
}; |
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 was deleted.
Oops, something went wrong.
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 +1,11 @@ | ||
import "@testing-library/jest-dom"; | ||
import $ from "jquery"; | ||
|
||
declare global { | ||
interface Window { | ||
$: typeof $; | ||
jQuery: typeof $; | ||
} | ||
} | ||
|
||
window.$ = window.jQuery = $; |
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,19 @@ | ||
import { getSunrayAngleInDegrees } from "./daylight-utils" | ||
|
||
describe("getSunrayAngleInDegrees", () => { | ||
it("should return the correct sunray angle in degrees", () => { | ||
const dayNum = 172; | ||
const earthTilt = 23.5; | ||
const lat = 37.7749; | ||
const result = getSunrayAngleInDegrees(dayNum, earthTilt, lat); | ||
expect(result).toBeCloseTo(75.7251); | ||
}); | ||
|
||
it("should return the correct sunray angle in degrees (90deg case)", () => { | ||
const dayNum = 171; | ||
const earthTilt = 23.5; | ||
const lat = 23.5; | ||
const result = getSunrayAngleInDegrees(dayNum, earthTilt, lat); | ||
expect(result).toBeCloseTo(90); | ||
}); | ||
}); |