Skip to content

Test Plan Main Components #182

@PascalDR

Description

@PascalDR

GraphView.tsx

Category Functionality Test Case Expected Outcome Done
Unit Tests Rendering Render LoadingAtom when showElement is ShowElement.Loading. LoadingAtom is displayed.
    Render ErrorViewAtom when showElement is ShowElement.Error. ErrorViewAtom is displayed with the correct error message.
    Render GraphCanvas when showElement is ShowElement.Graph. GraphCanvas is displayed with nodes and edges.
    Render ContextSideBar when sidebarVisible is true. Sidebar is displayed.
    Render notification when notification is set. Notification is displayed with the correct message.
Unit Tests Graph Updates Call updateGraph with new nodes and edges. Graph is updated and stored in session storage.
    Call onNodesRemove with a list of entities. Nodes are removed from the graph.
    Call onEdgeAdd with two nodes. Edge is added to the graph.
    Call onEdgeRemove with an edge ID. Edge is removed from the graph.
    Call onNodesAdd with a single node. Node is added to the discovery queue.
    Call onNodesAdd with multiple nodes. Nodes are added to the discovery list, and a warning modal is displayed.
Unit Tests Context Menu Call enableNodeContextMenu with a node ID. Node context menu is enabled, and sidebar is displayed.
    Call enableEdgeContextMenu with an edge ID. Edge context menu is enabled, and sidebar is displayed.
Unit Tests Session Management Call onSessionSave when a session name exists in session storage. Session is saved, and notification is displayed.
    Call onSessionSave when no session name exists in session storage. Save title modal is displayed.
    Call importView with a valid session. Graph is imported and displayed.
    Call importView with an invalid session. Error message is displayed.
Unit Tests Trust Chain Call evaluateTrustChain with selected nodes and edges. Trust chain is evaluated and displayed.
    Call onTCCopy when tc is defined. Trust chain is copied to clipboard, and notification is displayed.
Unit Tests Error Handling Call showErrorMessage with an error. Error is logged, and ErrorViewAtom is displayed.
    Call onModalError with error details. Error modal is displayed with the correct details.
Integration Tests GraphCanvas Interactions Click on a node in GraphCanvas. Node is selected, and it becomes active.
    Click on the canvas in GraphCanvas. All selections and active nodes are cleared.
    Perform a lasso selection in GraphCanvas. Selected nodes are highlighted.
    Right-click on a node in GraphCanvas. Node context menu is enabled, and sidebar is displayed.
    Right-click on an edge in GraphCanvas. Edge context menu is enabled, and sidebar is displayed.
Integration Tests Modal Interactions Open and interact with the "Add Entity" modal. Entity is added to the graph or discovery queue.
    Open and interact with the "Export" modal. Graph is exported as JSON (static or dynamic).
    Open and interact with the "Save Session" modal. Session is saved with the provided name.
    Open and interact with the "Error" modal. Error details are displayed, and modal is dismissed.
    Open and interact with the "Warning" modal. Nodes are added to the discovery queue or dismissed.
Performance Tests Graph Updates Add a large number of nodes and edges to the graph. Graph updates without significant performance degradation.
    Remove a large number of nodes and edges from the graph. Graph updates without significant performance degradation.
Regression Tests GraphCanvas Ensure previously fixed issues with node/edge interactions do not reoccur. No regressions are present.
  Session Management Ensure previously fixed issues with session import/export do not reoccur. No regressions are present.
UI/UX Tests Responsiveness Verify rendering on different screen sizes. UI adapts correctly to all screen sizes.
  Accessibility Ensure all interactive elements are keyboard-navigable and have ARIA labels. UI is accessible.

ContextSidebar.tsx

Category Functionality Test Case Expected Outcome Done
Unit Tests Rendering Render sidebar when visible is true. Sidebar is displayed with the correct styles.
    Do not render sidebar when visible is false. Sidebar is hidden with the correct styles.
    Render "No data Selected" warning when currentVisualizedData is undefined. Warning message is displayed with the correct icon and text.
    Render NodeMenuAtom when currentVisualizedData is a node. NodeMenuAtom is displayed with the correct props.
    Render EdgeMenuAtom when currentVisualizedData is an edge. EdgeMenuAtom is displayed with the correct props.
Unit Tests Close Button Click on the close button. onClose is triggered, and the sidebar is hidden.
Unit Tests Delete Button Click "Delete element from graph" when currentVisualizedData is a node. onNodesRemove is called with the correct node ID, and onClose is triggered.
    Click "Delete element from graph" when currentVisualizedData is an edge. onEdgeRemove is called with the correct edge ID, and onClose is triggered.
Unit Tests Select Linked Entity Button Click "Select linked entity on map" when currentVisualizedData is an edge. onSelection is called with the correct target node ID.
Unit Tests NodeMenuAtom Props Pass onNodesRemove to NodeMenuAtom. NodeMenuAtom calls onNodesRemove with the correct node IDs.
    Pass onNodesAdd to NodeMenuAtom. NodeMenuAtom calls onNodesAdd with the correct node IDs.
    Pass onEdgeAdd to NodeMenuAtom. NodeMenuAtom calls onEdgeAdd with the correct source and target node IDs.
    Pass isFailed to NodeMenuAtom. NodeMenuAtom correctly identifies failed nodes.
    Pass isInDiscoveryQueue to NodeMenuAtom. NodeMenuAtom correctly identifies nodes in the discovery queue.
    Pass isDiscovered to NodeMenuAtom. NodeMenuAtom correctly identifies discovered nodes.
    Pass isDisconnected to NodeMenuAtom. NodeMenuAtom correctly identifies disconnected nodes.
    Pass onSelection to NodeMenuAtom. NodeMenuAtom calls onSelection with the correct node ID.
    Pass onModalError to NodeMenuAtom. NodeMenuAtom calls onModalError with the correct error message.
Unit Tests EdgeMenuAtom Props Pass currentVisualizedData to EdgeMenuAtom. EdgeMenuAtom renders correctly with the provided edge data.
Integration Tests Sidebar Behavior Open sidebar and interact with NodeMenuAtom. Node-related actions (add, remove, etc.) are executed correctly.
    Open sidebar and interact with EdgeMenuAtom. Edge-related actions (remove, select linked entity, etc.) are executed correctly.
    Open sidebar, click "Delete element from graph," and verify the graph updates. Node or edge is removed from the graph, and sidebar is closed.
    Open sidebar, click "Select linked entity on map," and verify the graph highlights the entity. Linked entity is highlighted on the graph.
UI/UX Tests Responsiveness Verify sidebar rendering on different screen sizes. Sidebar adapts correctly to all screen sizes.
  Accessibility Ensure all interactive elements (buttons, icons) are keyboard-navigable and have ARIA labels. Sidebar is accessible.
Internationalization Translations Verify that translations are applied based on the user's locale. Correct translations are displayed for all text.
    Verify that the default locale is en-EN if the browser locale is unavailable. Default translations are displayed.

AnchorList.tsx

Category Functionality Test Case Expected Outcome Done
Unit Tests Rendering Render the component with the default trustChainList. The list is displayed with the correct number of items per page (5).
    Render the ItemsRenderer with a list of items. Each item is displayed with the correct name and truncated URL.
    Render the "Add" button for each item in the list. The "Add" button is displayed with the correct icon and text.
Unit Tests Button Functionality Click the "Add" button for an item. The trustAnchorUrl is saved in sessionStorage, and the user is navigated to /graphView.
    Verify that sessionStorage is cleared for currentSession and currentSessionName when "Add" is clicked. sessionStorage values for currentSession and currentSessionName are removed.
    Verify that the trustAnchorUrl event is dispatched when "Add" is clicked. The trustAnchorUrl event is dispatched.
Unit Tests Filtering Apply a filter that matches some items in the list. Only the matching items are displayed.
    Apply a filter that matches no items in the list. No items are displayed.
    Apply a filter with mixed-case input. The filter is case-insensitive, and matching items are displayed.
Unit Tests Pagination Verify that only 5 items are displayed per page. The list displays exactly 5 items per page.
    Navigate to the next page of the list. The next set of items is displayed.
    Navigate to the previous page of the list. The previous set of items is displayed.
    Navigate to a specific page using pagination controls. The correct set of items for the selected page is displayed.
Integration Tests Navigation Click the "Add" button for an item and verify navigation to /graphView. The user is navigated to /graphView with replace: true.
    Verify that the trustAnchorUrl is correctly saved in sessionStorage before navigation. The correct trustAnchorUrl is stored in sessionStorage.
Integration Tests Interaction with PaginatedListAtom Pass trustChainList to PaginatedListAtom. The list is paginated correctly with 5 items per page.
    Pass ItemsRenderer to PaginatedListAtom. Items are rendered correctly using the custom renderer.
    Pass trustAnchorFilter to PaginatedListAtom. The filter function works correctly, and only matching items are displayed.
UI/UX Tests Responsiveness Verify rendering on different screen sizes. The list and buttons adapt correctly to all screen sizes.
  Accessibility Ensure all interactive elements (buttons) are keyboard-navigable and have ARIA labels. The component is accessible.
Performance Tests Large List Handling Render the component with a large trustChainList. The component renders without performance degradation.
    Apply a filter to a large trustChainList. The filter works efficiently without noticeable delay.
Regression Tests Session Management Ensure previously fixed issues with sessionStorage handling do not reoccur. No regressions are present.
  Navigation Ensure previously fixed issues with navigation to /graphView do not reoccur. No regressions are present.

Header.tsx

Category Functionality Test Case Expected Outcome
Unit Tests Rendering Render the Header component. The Header component is displayed with the correct structure and styles.
    Verify that the SlimHeader component is rendered. The SlimHeader component is displayed correctly.
    Verify that the NavBarAtom component is rendered. The NavBarAtom component is displayed correctly.
Integration Tests Component Composition Verify that SlimHeader and NavBarAtom are rendered together within the Header. Both components are displayed in the correct order and layout.
UI/UX Tests Responsiveness Verify rendering on different screen sizes. The Header adapts correctly to all screen sizes.
  Accessibility Ensure all interactive elements in SlimHeader and NavBarAtom are keyboard-navigable. The Header is accessible.
Performance Tests Rendering Performance Render the Header component multiple times. The component renders without performance degradation.
Regression Tests Component Rendering Ensure previously fixed issues with SlimHeader or NavBarAtom rendering do not reoccur. No regressions are present.

RestoreView.tsx

Category Functionality Test Case Expected Outcome Done
Unit Tests Rendering Render the RestoreView component. The component is displayed with the correct structure and styles.
Render the "From File" tab as active by default. The "From File" tab is active, and the ViewImportAtom is displayed.
Render the "From Previous Session" tab when clicked. The "From Previous Session" tab is active, and the session list is displayed.
Render the session table with the correct headers. Headers for "Screenshot," "Session Name," "Date," and "Actions" are displayed.
Render the session table rows with session data. Each row displays the correct screenshot, session name, date, and action buttons.
Render "No session available" message when there are no sessions. The message is displayed when the session list is empty.
Unit Tests Tab Switching Click the "From File" tab. The "From File" tab becomes active, and the ViewImportAtom is displayed.
Click the "From Previous Session" tab. The "From Previous Session" tab becomes active, and the session list is displayed.
Unit Tests Session Actions Click the "Restore" button for a session. The session is restored, and the user is navigated to /graphView.
Click the "Delete" button for a session. The session is deleted, and the session list is updated.
Verify that restoreSession is called with the correct session name when "Restore" is clicked. The correct session is restored.
Verify that deleteSession is called with the correct session name when "Delete" is clicked. The correct session is deleted.
Unit Tests Pagination Verify that only 5 sessions are displayed per page. The session table displays exactly 5 rows per page.
Navigate to the next page of the session list. The next set of sessions is displayed.
Navigate to the previous page of the session list. The previous set of sessions is displayed.
Navigate to a specific page using pagination controls. The correct set of sessions for the selected page is displayed.
Integration Tests Session Management Restore a session and verify navigation to /graphView. The user is navigated to /graphView with replace: true.
Delete a session and verify that the session list is updated. The session is removed from the list, and the table is updated.
Verify that getSessionsList is called to fetch the session list. The session list is fetched correctly.
Integration Tests Interaction with PaginatedListAtom Pass the session list to PaginatedListAtom. The session list is paginated correctly with 5 items per page.
Pass ItemsRenderer to PaginatedListAtom. Sessions are rendered correctly using the custom renderer.
UI/UX Tests Responsiveness Verify rendering on different screen sizes. The component adapts correctly to all screen sizes.
Accessibility Ensure all interactive elements (buttons, tabs) are keyboard-navigable and have ARIA labels. The component is accessible.
Performance Tests Large Session List Handling Render the component with a large session list. The component renders without performance degradation.
Navigate through pages of a large session list. Pagination works efficiently without noticeable delay.
Regression Tests Session Management Ensure previously fixed issues with session restoration or deletion do not reoccur. No regressions are present.
Tab Switching Ensure previously fixed issues with tab switching do not reoccur. No regressions are present.

UrlInput.tsx

Category Functionality Test Case Expected Outcome Done
Unit Tests Rendering Render the UrlInput component. The input field and submit button are displayed correctly.
Verify the placeholder text for the input field when searchType is "entity". The placeholder displays the correct translation for "Insert Entity URL".
Verify the placeholder text for the input field when searchType is "anchor". The placeholder displays the correct translation for "Insert Anchor URL".
Verify the "invalid URL" error message is hidden by default. The error message is not visible.
Unit Tests Input Handling Type a valid URL into the input field. The inputValue state is updated with the entered URL.
Type an invalid URL into the input field. The inputValue state is updated with the entered value.
Unit Tests Submit Button Click the submit button with a valid URL. The URL is saved in sessionStorage, and the user is navigated to /graphView.
Click the submit button with an invalid URL. The "invalid URL" error message is displayed.
Verify that sessionStorage is cleared for currentSession and currentSessionName on submit. sessionStorage values for currentSession and currentSessionName are removed.
Verify that the trustAnchorUrl event is dispatched on submit. The trustAnchorUrl event is dispatched.
Unit Tests Keyboard Handling Press "Enter" with a valid URL in the input field. The URL is saved in sessionStorage, and the user is navigated to /graphView.
Press "Enter" with an invalid URL in the input field. The "invalid URL" error message is displayed.
Unit Tests Error Handling Submit an invalid URL and verify the error message is displayed. The "invalid URL" error message is visible.
Submit a valid URL and verify the error message is hidden. The "invalid URL" error message is not visible.
Integration Tests Session Management Submit a valid URL and verify that trustAnchorUrl is saved in sessionStorage. The correct trustAnchorUrl is stored in sessionStorage.
Submit a valid URL and verify navigation to /graphView. The user is navigated to /graphView with replace: true.
Submit an invalid URL and verify that navigation does not occur. The user remains on the current page.
Integration Tests Event Handling Verify that the trustAnchorUrl event is dispatched when a valid URL is submitted. The trustAnchorUrl event is dispatched.
Verify that handleCollapseVisibility is called with the correct arguments for valid URLs. The collapse element is hidden.
Verify that handleCollapseVisibility is called with the correct arguments for invalid URLs. The collapse element is shown.
Verify that cleanInput is called when a valid URL is submitted. The input field is cleared.
UI/UX Tests Responsiveness Verify rendering on different screen sizes. The component adapts correctly to all screen sizes.
Accessibility Ensure all interactive elements (input field, button) are keyboard-navigable and have ARIA labels. The component is accessible.
Performance Tests Input Handling Type a large string into the input field. The input field handles the input without performance degradation.
Submit multiple valid URLs in quick succession. The component processes each submission correctly without performance issues.
Regression Tests Session Management Ensure previously fixed issues with sessionStorage handling do not reoccur. No regressions are present.
Error Handling Ensure previously fixed issues with error message visibility do not reoccur. No regressions are present.

Metadata

Metadata

Assignees

Labels

enhancementSomething improving existing features

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions