Skip to content

Commit 40d78cf

Browse files
committed
fix: test case and readme addition
1 parent 0677abd commit 40d78cf

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ default_screen_deployment_status:
195195

196196
Only screens set to `true` in this configuration file will be processed by the deployment workflow for Advanced Mode. This allows you to selectively roll out your custom screens.
197197

198+
<a id="testing"></a>
199+
200+
## Testing
201+
202+
This project uses [Jest](https://jestjs.io/) for unit and integration testing of screen components.
203+
204+
### Running Tests
205+
206+
To run the entire test suite:
207+
208+
```bash
209+
npm test
210+
```
211+
198212
<a id="technical-details"></a>
199213

200214
## 🔍 Technical Details

src/__mocks__/@auth0/auth0-acul-js/login-id.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
interface MockLoginIdInstance {
88
login: jest.Mock;
9-
socialLogin: jest.Mock;
9+
federatedLogin: jest.Mock;
1010
passkeyLogin: jest.Mock;
1111
pickCountryCode: jest.Mock;
1212
screen: {
@@ -38,7 +38,7 @@ interface MockLoginIdInstance {
3838

3939
const mockLoginIdInstance: MockLoginIdInstance = {
4040
login: jest.fn(),
41-
socialLogin: jest.fn(),
41+
federatedLogin: jest.fn(),
4242
passkeyLogin: jest.fn(),
4343
pickCountryCode: jest.fn(),
4444
screen: {

src/screens/login-id/__tests__/index.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("LoginIdScreen", () => {
1717
MockedLoginIdInstance.mockClear();
1818
mockInstance = {
1919
login: jest.fn(),
20-
socialLogin: jest.fn(),
20+
federatedLogin: jest.fn(),
2121
passkeyLogin: jest.fn(),
2222
pickCountryCode: jest.fn(),
2323
screen: {
@@ -255,7 +255,7 @@ describe("LoginIdScreen", () => {
255255
).toBeInTheDocument();
256256
});
257257

258-
it("should call socialLogin method when button clicked", async () => {
258+
it("should call federatedLogin method when button clicked", async () => {
259259
MockConfigUtils.configureTransaction(mockInstance, {
260260
alternateConnections: [CommonTestData.socialConnections[0]],
261261
});
@@ -264,7 +264,7 @@ describe("LoginIdScreen", () => {
264264

265265
await ScreenTestUtils.clickButton(/continue with google/i);
266266

267-
expect(mockInstance.socialLogin).toHaveBeenCalledWith({
267+
expect(mockInstance.federatedLogin).toHaveBeenCalledWith({
268268
connection: "google-oauth2",
269269
});
270270
});

0 commit comments

Comments
 (0)