Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
429 changes: 429 additions & 0 deletions docs/OpenID4VPIntegrationGuide.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inji-web/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RootState } from './types/redux';
import { getDirCurrentLanguage } from './utils/i18n';
import { PageNotFound } from './pages/PageNotFound';
import { AuthorizationPage } from './pages/AuthorizationPage';
import { UserAuthorizationPage } from './pages/UserAuthorizationPage';
import { VPAuthorizationPage } from './pages/VPAuthorizationPage';
import { HomePage } from './pages/HomePage';
import LoginSessionStatusChecker from './components/Common/LoginSessionStatusChecker';
import { PasscodePage } from './pages/User/Passcode/PasscodePage';
Expand Down Expand Up @@ -129,7 +129,7 @@ export const AppRouter = () => {
<Route path={Pages.USER}>
<Route path={Pages.PASSCODE} element={renderBasedOnAuthStatus(PasscodePage)} />
<Route path={Pages.RESET_PASSCODE} element={renderBasedOnAuthStatus(ResetPasscodePage)} />
<Route path={Pages.AUTHORIZE} element={wrapElement(<UserAuthorizationPage />)} />
<Route path={Pages.AUTHORIZE} element={wrapElement(<VPAuthorizationPage />)} />
<Route element={<Layout />}>

<Route path={Pages.ISSUERS} element={<RedirectToUserHome />} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import { InfoTooltipTrigger } from '../../../../components/Common/ToolTip/InfoTooltipTrigger';
import { InfoTooltip } from '../../../../components/Common/ToolTip/InfoTooltip';

jest.mock('../../../../assets/infoIconWhite.svg', () => 'mocked-info-icon-path');

describe('InfoTooltipTrigger Component', () => {
describe('InfoTooltip Component', () => {
const defaultProps = {
infoButtonText: 'Info',
tooltipText: 'This is a helpful tooltip message',
Expand All @@ -14,7 +14,7 @@ describe('InfoTooltipTrigger Component', () => {
};

const renderInfoTooltip = (props = {}) => {
return render(<InfoTooltipTrigger {...defaultProps} {...props} />);
return render(<InfoTooltip {...defaultProps} {...props} />);
};

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`InfoTooltipTrigger Component Initial rendering should match snapshot with custom props 1`] = `
exports[`InfoTooltip Component Initial rendering should match snapshot with custom props 1`] = `
<DocumentFragment>
<div
class="relative inline-block mt-4 sm:mt-5 custom-class"
Expand All @@ -27,7 +27,7 @@ exports[`InfoTooltipTrigger Component Initial rendering should match snapshot wi
</DocumentFragment>
`;

exports[`InfoTooltipTrigger Component Initial rendering should match snapshot with default props 1`] = `
exports[`InfoTooltip Component Initial rendering should match snapshot with default props 1`] = `
<DocumentFragment>
<div
class="relative inline-block mt-4 sm:mt-5 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jest.mock("../../../components/Common/Buttons/BorderedButton", () => ({
),
}));

jest.mock("../../../components/Common/ToolTip/InfoTooltipTrigger", () => ({
InfoTooltipTrigger: ({ infoButtonText, tooltipText, testId }: any) => (
jest.mock("../../../components/Common/ToolTip/InfoTooltip", () => ({
InfoTooltip: ({ infoButtonText, tooltipText, testId }: any) => (
<div data-testid={testId}>
{infoButtonText} - {tooltipText}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.mock("../../hooks/useApi", () => ({
jest.mock("../../hooks/useApiErrorHandler");
const mockUseApiErrorHandler = useApiErrorHandler as jest.Mock;

jest.mock("../../modals/LoadingModal", () => ({
jest.mock("../../modals/LoaderModal", () => ({
LoaderModal: ({ isOpen }: { isOpen: boolean }) =>
isOpen ? <div data-testid="modal-loader-card" /> : null,
}));
Expand Down
2 changes: 1 addition & 1 deletion inji-web/src/__tests__/hooks/useApiErrorHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('useApiErrorHandler', () => {

const { result } = renderHook(() =>
useApiErrorHandler({
retryableErrorCodes: [ERROR_TYPES.UNKNOWN]
errorCodesToRetry: [ERROR_TYPES.UNKNOWN]
})
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jest.mock('../../modals/NoMatchingCredentialsModal', () => ({
),
}));

jest.mock('../../modals/LoadingModal', () => ({
jest.mock('../../modals/LoaderModal', () => ({
LoaderModal: ({ isOpen, message }: any) => (
isOpen ? (
<div data-testid="modal-loader-card">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { LoaderModal } from "../../modals/LoadingModal";
import { LoaderModal } from "../../modals/LoaderModal";
import { useTranslation } from "react-i18next";

// Mock dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import { UserAuthorizationPage } from '../../pages/UserAuthorizationPage';
import { VPAuthorizationPage } from '../../pages/VPAuthorizationPage';
import { api, ContentTypes } from "../../utils/api";
import { ROUTES } from "../../utils/constants";
import { PresentationCredential } from '../../types/components';
Expand Down Expand Up @@ -80,7 +80,7 @@ jest.mock('../../components/User/Sidebar', () => ({
}));

const MockLoaderModal = jest.fn();
jest.mock('../../modals/LoadingModal', () => ({
jest.mock('../../modals/LoaderModal', () => ({
LoaderModal: ({ isOpen, title }: any) => {
MockLoaderModal({ isOpen, title });
return isOpen ? <div data-testid="modal-loader">{title}</div> : null;
Expand Down Expand Up @@ -244,7 +244,7 @@ const renderComponent = (route = "/user/authorize?client_id=mock-client&presenta
return render(
<Provider store={mockStore as any}>
<MemoryRouter initialEntries={[route]}>
<UserAuthorizationPage />
<VPAuthorizationPage />
</MemoryRouter>
</Provider>
);
Expand Down Expand Up @@ -285,7 +285,7 @@ const mockOnRetry = jest.fn();
let mockErrorHandlerReturnValue: ReturnType<typeof useApiErrorHandler>;


describe('UserAuthorizationPage', () => {
describe('VPAuthorizationPage', () => {
beforeEach(() => {
jest.clearAllMocks();
mockRejectVerifierRequest.mockImplementation(async (options) => {
Expand Down Expand Up @@ -439,7 +439,7 @@ describe('UserAuthorizationPage', () => {
);
});

rerender(<UserAuthorizationPage />); // Re-render to show updated hook state
rerender(<VPAuthorizationPage />); // Re-render to show updated hook state

await waitFor(() => {
expect(screen.getByTestId('modal-error-card')).toBeVisible();
Expand Down Expand Up @@ -531,7 +531,7 @@ describe('UserAuthorizationPage', () => {
);
});

rerender(<UserAuthorizationPage />);
rerender(<VPAuthorizationPage />);

await waitFor(() => {
expect(screen.getByTestId('modal-error-card')).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`UserAuthorizationPage matches snapshot when CredentialRequestModal is visible (trusted flow) 1`] = `
exports[`VPAuthorizationPage matches snapshot when CredentialRequestModal is visible (trusted flow) 1`] = `
<DocumentFragment>
<div
class="flex min-h-screen bg-gray-50"
Expand Down Expand Up @@ -39,7 +39,7 @@ exports[`UserAuthorizationPage matches snapshot when CredentialRequestModal is v
</DocumentFragment>
`;

exports[`UserAuthorizationPage matches snapshot when TrustVerifierModal is visible (untrusted flow) 1`] = `
exports[`VPAuthorizationPage matches snapshot when TrustVerifierModal is visible (untrusted flow) 1`] = `
<DocumentFragment>
<div
class="flex min-h-screen bg-gray-50"
Expand Down
Loading
Loading