-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ES-675] Added basic test case for claim-details component and some U…
…I fixes. (#749) Signed-off-by: GurukiranP <talk2gurukiran@gmail.com>
- Loading branch information
Showing
7 changed files
with
14,330 additions
and
8,619 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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,38 @@ | ||
import React from "react"; | ||
import ClaimDetails from "../components/ClaimDetails"; | ||
import { render } from "@testing-library/react"; | ||
|
||
const hash = | ||
"#eyJ0cmFuc2FjdGlvbklkIjoiOGNXSFVUWHRaa1hkbC1MS21oX2lMUkMwQmV3MlBrTG5mRkhaQ2pDOVFDWSIsImxvZ29VcmwiOiJodHRwczovL2hlYWx0aHNlcnZpY2VzLmRldi5tb3NpcC5uZXQvaW1hZ2VzL2RvY3Rvcl9sb2dvLnBuZyIsImF1dGhGYWN0b3JzIjpbW3sidHlwZSI6Ik9UUCIsImNvdW50IjowLCJzdWJUeXBlcyI6bnVsbH1dLFt7InR5cG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MC9mb3Jnb3QtcGFzc3dvcmQifSwiZUtZQy1zdGVwcy5jb25maWciOiJodHRwOi8vbG9jYWxob3N0OjMwMDAvaWRlbnRpdHktdmVyaWZpY2F0aW9uIiwiZXJyb3IuYmFubmVyLmNsb3NlLXRpbWVyIjoxMCwiYXV0aC5mYWN0b3Iua2JhLmluZGl2aWR1YWwtaWQtZmllbGQiOiJwb2xpY3lOdW1iZXIiLCJhdXRoLmZhY3Rvci5rYmEuZmllbGQtZGV0YWlscyI6W119LCJyZWRpcmVjdFVyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTAwMC91c2VycHJvZmlsZSIsImNsaWVudE5hbWUiOnsiQG5vbmUiOiJIZWFsdGggc2VydmljZSJ9LCJjcmVkZW50aWFsU2NvcGVzIjpbXX0="; | ||
|
||
const url = | ||
"http://localhost:3000/claim-details?nonce=ere973eieljznge2311&state=eree2311&consentAction=CAPTURE&authenticationTime=1717572654" + | ||
hash; | ||
|
||
jest.mock("react-i18next", () => ({ | ||
// this mock makes sure any components using the translate hook can use it without a warning being shown | ||
useTranslation: () => { | ||
return { | ||
t: (str) => str, | ||
i18n: { | ||
changeLanguage: () => new Promise(() => {}), | ||
// You can include here any property your component may use | ||
}, | ||
}; | ||
}, | ||
initReactI18next: { | ||
type: "3rdParty", | ||
init: () => {}, | ||
}, | ||
})); | ||
|
||
describe("ClaimDetails Component", () => { | ||
test("should render ClaimDetails component", async () => { | ||
Object.defineProperty(window, "location", { | ||
get() { | ||
return { href: url }; | ||
}, | ||
}); | ||
render(<ClaimDetails />); | ||
}); | ||
}); |