Skip to content

Commit

Permalink
2436 1 click verification (#2463)
Browse files Browse the repository at this point in the history
* 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
digitalmnt committed May 21, 2024
1 parent 6326e43 commit bf3b0b4
Show file tree
Hide file tree
Showing 20 changed files with 589 additions and 906 deletions.
52 changes: 52 additions & 0 deletions app/__tests__/components/DashboardScorePanel.test.tsx
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
});
});
50 changes: 0 additions & 50 deletions app/__tests__/components/RefreshMyStampsModal.test.tsx

This file was deleted.

163 changes: 0 additions & 163 deletions app/__tests__/components/RefreshMyStampsModalContent.test.tsx

This file was deleted.

68 changes: 0 additions & 68 deletions app/__tests__/components/RefreshMyStampsModalContentCard.test.tsx

This file was deleted.

Loading

0 comments on commit bf3b0b4

Please sign in to comment.