-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(app): style dashboard components to match new designs * feat(app): check and verify possible stamps * feat(app): full onboard process * feat(app): use jotai to handle state and indicate loading status across app * feat(app): testing and remaining oneClickVerifcation functionality * fix(app): copy --no-verify * chore(app): update copy and fine tune test * chore(app): default value for iam url * fix(app): just test for providers * chore(app): cleanup removed tests * fix(app): remove oldd file
- Loading branch information
1 parent
6326e43
commit bf3b0b4
Showing
20 changed files
with
589 additions
and
906 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,52 @@ | ||
import React from "react"; | ||
import { screen } from "@testing-library/react"; | ||
import { DashboardScorePanel } from "../../components/DashboardScorePanel"; | ||
|
||
import { renderWithContext, makeTestCeramicContext } from "../../__test-fixtures__/contextTestHelpers"; | ||
import { CeramicContextState } from "../../context/ceramicContext"; | ||
|
||
const mockCeramicContext: CeramicContextState = makeTestCeramicContext(); | ||
|
||
jest.mock("../../context/userState", () => ({ | ||
mutableUserVerificationAtom: { | ||
toString: () => "mocked-user-verification-atom", | ||
read: jest.fn(), | ||
write: jest.fn(), | ||
}, | ||
})); | ||
|
||
let mockLoadingState = { loading: true }; | ||
|
||
jest.mock("jotai", () => ({ | ||
useAtom: jest.fn().mockImplementation((atom) => { | ||
if (atom.toString() === "mocked-user-verification-atom") { | ||
return [mockLoadingState, jest.fn()]; | ||
} | ||
return [undefined, jest.fn()]; | ||
}), | ||
atom: jest.fn(), | ||
useAtomValue: jest.fn(), | ||
})); | ||
|
||
jest.mock("../../hooks/useCustomization", () => ({ | ||
useCustomization: jest.fn(), | ||
})); | ||
|
||
jest.mock("../../utils/customizationUtils", () => ({ | ||
isDynamicCustomization: jest.fn(), | ||
})); | ||
|
||
describe("DashboardScorePanel", () => { | ||
it("should indicate the loading state", () => { | ||
renderWithContext(mockCeramicContext, <DashboardScorePanel className="test" />); | ||
expect(screen.getByText("Updating")).toBeInTheDocument(); | ||
}); | ||
|
||
it("should handle when not loading", () => { | ||
// Set the loading state to false for this test | ||
mockLoadingState = { loading: false }; | ||
renderWithContext(mockCeramicContext, <DashboardScorePanel className="test" />); | ||
// Check for some other text or element that indicates it is not in loading state | ||
expect(screen.getByText("0")).toBeInTheDocument(); // Adjust this based on your actual UI | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
163 changes: 0 additions & 163 deletions
163
app/__tests__/components/RefreshMyStampsModalContent.test.tsx
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
app/__tests__/components/RefreshMyStampsModalContentCard.test.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.