diff --git a/forms-flow-web/__mocks__/@formsflow/components.js b/forms-flow-web/__mocks__/@formsflow/components.js index 0251b9e49f..0475754454 100644 --- a/forms-flow-web/__mocks__/@formsflow/components.js +++ b/forms-flow-web/__mocks__/@formsflow/components.js @@ -1,29 +1,28 @@ import PropTypes from 'prop-types'; -export const CustomButton = ({ - onClick, - label = "Edit", - dataTestId, - variant, - size, - className = "", - ariaLabel, - disabled = false +export const CustomButton = ({ + onClick, + label = "Edit", + dataTestId, + variant, + size, + className = "", + ariaLabel, + disabled = false }) => { // Create base className and add size and variant if present let buttonClass = className; - + if (size) { buttonClass += ` btn-${size}`; } - + if (variant) { buttonClass += ` btn-${variant}`; } return ( - - - ); }; @@ -48,98 +46,9 @@ CustomButton.propTypes = { disabled: PropTypes.bool }; -const NormalDropdown = ({ - limit, - onLimitChange, - pageOptions, - isDropdownOpen, - toggleDropdown, - 'data-testid': dataTestId -}) => { - return ( -
- - -
- ); -}; -export const TableFooter = ({ - limit, - activePage, - totalCount, - handlePageChange, - onLimitChange, - pageOptions, - isDropdownOpen, - toggleDropdown, - dataTestId="table-footer" -}) => { - return ( - - -
- - Showing {limit * activePage - (limit - 1)} to  - {Math.min(limit * activePage, totalCount)} of  - {totalCount} - -
- - -
- - {activePage} - -
- - {pageOptions && ( - -
- Rows per page -
- -
-
- - )} - - ); -}; - - -export const CloseIcon = ({ - onClick, - dataTestId +export const CloseIcon = ({ + onClick, + dataTestId }) => { return ( { - return ( - - - ); -} - -export const AngleRightIcon = ({ - onClick, - dataTestId="right-icon" -}) => { - return ( - - - ); -} - -export const DownArrowIcon = ({ - downIconClick, - downIconDataTestId -}) => { - return ( - - - ); -} - -export const FilterIcon = ({ - handleFilterIconClick, - filterDataTestId +export const FilterIcon = ({ + handleFilterIconClick, + filterDataTestId }) => { return ( { return ( { return ( { - return ( -
- setSearch(e.target.value)} - onKeyDown={(e) => e.key === 'Enter' && handleSearch()} - placeholder={placeholder} - title={title} - aria-label={placeholder} - data-testid="custom-search-input" - /> - {search && !searchLoading && ( - - - )} - {searchLoading &&
Loading...
} -
- ); -}; - -CustomSearch.propTypes = { - searchLoading: PropTypes.bool.isRequired, - handleClearSearch: PropTypes.func, - search: PropTypes.string.isRequired, - setSearch: PropTypes.func, - handleSearch: PropTypes.func, - placeholder: PropTypes.string, - title: PropTypes.string, - dataTestId: PropTypes.string -}; +// export const CustomSearch = ({ +// searchLoading, +// handleClearSearch, +// search, +// setSearch, +// handleSearch, +// placeholder = "Search...", +// title = "Search", +// dataTestId +// }) => { +// return ( +//
+// setSearch(e.target.value)} +// onKeyDown={(e) => e.key === 'Enter' && handleSearch()} +// placeholder={placeholder} +// title={title} +// aria-label={placeholder} +// data-testid="custom-search-input" +// /> +// {search && !searchLoading && ( +// + +// )} +// {searchLoading &&
Loading...
} +//
+// ); +// }; + +// CustomSearch.propTypes = { +// searchLoading: PropTypes.bool.isRequired, +// handleClearSearch: PropTypes.func, +// search: PropTypes.string.isRequired, +// setSearch: PropTypes.func, +// handleSearch: PropTypes.func, +// placeholder: PropTypes.string, +// title: PropTypes.string, +// dataTestId: PropTypes.string +// }; export const ImportModal = ({ showModal, onClose, onImport, isLoading, errorMessage }) => (
@@ -574,61 +391,104 @@ ImportModal.propTypes = { isLoading: PropTypes.bool.isRequired, errorMessage: PropTypes.string }; - - -export const NoDataFound = () => { +const NormalDropdown = ({ + limit, + onLimitChange, + pageOptions, + isDropdownOpen, + toggleDropdown, + 'data-testid': dataTestId +}) => { return ( -
- Nothing is found based on your search query. Please try again. +
+ +
    + {pageOptions?.map((option) => ( +
  • { + onLimitChange(option.value); + toggleDropdown(); + }} + > + {`${option.value} per page`} +
  • + ))} +
); }; - -NoDataFound.propTypes = {}; - -NormalDropdown.propTypes = { - limit: PropTypes.number.isRequired, - onLimitChange: PropTypes.func.isRequired, - pageOptions: PropTypes.arrayOf( - PropTypes.shape({ - value: PropTypes.number.isRequired, - label: PropTypes.string - }) - ), - isDropdownOpen: PropTypes.bool.isRequired, - toggleDropdown: PropTypes.func.isRequired, - 'data-testid': PropTypes.string -}; - -TableFooter.propTypes = { - limit: PropTypes.number.isRequired, - activePage: PropTypes.number.isRequired, - totalCount: PropTypes.number.isRequired, - handlePageChange: PropTypes.func.isRequired, - onLimitChange: PropTypes.func.isRequired, - pageOptions: PropTypes.arrayOf( - PropTypes.shape({ - value: PropTypes.number.isRequired, - label: PropTypes.string - }) - ), - isDropdownOpen: PropTypes.bool.isRequired, - toggleDropdown: PropTypes.func.isRequired, - dataTestId: PropTypes.string +export const TableFooter = ({ + limit, + activePage, + totalCount, + handlePageChange, + onLimitChange, + pageOptions, + isDropdownOpen, + toggleDropdown, + dataTestId="table-footer" +}) => { + return ( + + +
+ + Showing {limit * activePage - (limit - 1)} to  + {Math.min(limit * activePage, totalCount)} of  + {totalCount} + +
+ + +
+ + {activePage} + +
+ + {pageOptions && ( + +
+ Rows per page +
+ +
+
+ + )} + + ); }; -AngleLeftIcon.propTypes = { - onClick: PropTypes.func, - dataTestId: PropTypes.string -}; -SortIcon.propTypes = { - onClick: PropTypes.func, - downIconClick: PropTypes.func, - disabled: PropTypes.bool, - dataTestId: PropTypes.string +export const NoDataFound = ({message,dataTestId}) => { + return ( +
+ {message} +
+ ); }; +NoDataFound.propTypes = {}; export const ConfirmModal = ({show, @@ -649,7 +509,7 @@ export const ConfirmModal = ({show, secondoryBtnariaLabel = 'Cancel Button', secondaryBtnLoading= false}) => { return ( - Title - +

Primary message

Secondary message

- +
-
-
Sample content to show
+
Sample content to show
; }; @@ -783,3 +643,237 @@ export const FailedIcon = () => ( /> ); + +export const ReusableProcessTableRow = ({ item, buttonLabel, dataTestId="reusable-process-table-row" }) => { + return ( + + + {item.name} + + + {item.processKey} + + {item.modified || 'N/A'} + + + + {item.status === 'Published' ? 'Live' : 'Draft'} + + + + + + + + + ); +}; + +ReusableProcessTableRow.propTypes = { + item: PropTypes.shape({ + name: PropTypes.string.isRequired, + processKey: PropTypes.string, + modified: PropTypes.string, + status: PropTypes.string, + _id: PropTypes.string.isRequired, + }).isRequired, + buttonLabel: PropTypes.string.isRequired, +}; + +export const BuildModal = ({ show, title, contents }) => { + return ( +
+ {show && ( +
+
+

{title}

+ +
+
+ {contents.map(({ id, heading, body }) => ( + + ))} +
+
+ )} +
+ ); +}; + +BuildModal.propTypes = { + show: PropTypes.bool.isRequired, + title: PropTypes.string.isRequired, + contents: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.number.isRequired, + heading: PropTypes.string.isRequired, + body: PropTypes.string.isRequired, + }) + ).isRequired, +}; + + +export const CustomSearch = ({ + searchLoading, + handleClearSearch, + search, + setSearch, + handleSearch, + placeholder = "Search...", + title = "Search", + dataTestId +}) => { + return ( +
+ setSearch(e.target.value)} + onKeyDown={(e) => e.key === "Enter" && handleSearch()} + placeholder={placeholder} + title={title} + aria-label={placeholder} + data-testid={`${dataTestId}`} + /> + {search && !searchLoading && ( + + )} + {searchLoading && ( +
+ Loading... +
+ )} +
+ ); +}; + +CustomSearch.propTypes = { + searchLoading: PropTypes.bool.isRequired, + handleClearSearch: PropTypes.func.isRequired, + search: PropTypes.string.isRequired, + setSearch: PropTypes.func.isRequired, + handleSearch: PropTypes.func.isRequired, + placeholder: PropTypes.string, + title: PropTypes.string, + dataTestId: PropTypes.string, +}; + + +export const AngleLeftIcon = ({ + onClick, + dataTestId="left-icon" +}) => { + return ( + + + ); +} + +export const AngleRightIcon = ({ + onClick, + dataTestId="right-icon" +}) => { + return ( + + + ); +} + +export const DownArrowIcon = ({ + downIconClick, + downIconDataTestId +}) => { + return ( + + + ); +} \ No newline at end of file diff --git a/forms-flow-web/src/_tests_/unit/BPMN/DecisionTable.test.js b/forms-flow-web/src/_tests_/unit/BPMN/DecisionTable.test.js new file mode 100644 index 0000000000..a0616dc5bd --- /dev/null +++ b/forms-flow-web/src/_tests_/unit/BPMN/DecisionTable.test.js @@ -0,0 +1,195 @@ +import React from "react"; +import { + render as rtlRender, + fireEvent, + waitFor, + screen, +} from "@testing-library/react"; +import userEvent from '@testing-library/user-event'; +import { Provider } from "react-redux"; +import "@testing-library/jest-dom"; +import { configureStore } from "@reduxjs/toolkit"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { createMemoryHistory } from "history"; +import { Router, Route } from "react-router-dom"; +import { Switch } from "react-router-dom/cjs/react-router-dom.min"; +import rootReducer from "../rootReducer"; +import { mockstate } from "../mockState"; +import ProcessTable from "../../../routes/Design/Process/ProcessTable"; + +jest.mock("connected-react-router", () => ({ + push: jest.fn(), +})); +jest.mock("@formsflow/components", () => ({ + ...jest.requireActual("../../../__mocks__/@formsflow/components"), + FilterIcon: () =>
Filter Icon
, + RefreshIcon: () =>
Refresh Icon
, + SortModal: ({ showSortModal, onClose, primaryBtnAction }) => ( + showSortModal ? ( +
+ + +
+ ) : null + ) + })); +const queryClient = new QueryClient(); +let store; +let history; + +function renderWithRouterMatch(Ui, { path = "/", route = "/", props = {} }) { + history = createMemoryHistory({ initialEntries: [route] }); + return rtlRender( + + + + + } /> + + + + + ); +} + +describe('DMN ProcessTable Component Tests', () => { + beforeEach(() => { + store = configureStore({ + reducer: rootReducer, + preloadedState: mockstate, + }); + store.dispatch = jest.fn(); + + renderWithRouterMatch(ProcessTable, { + path: "/:viewType", + route: "/decision-table", + }); + + store.dispatch.mockClear(); + jest.clearAllMocks(); + }); + + it("should render DMN table header correctly", () => { + expect(screen.getByTestId("Name-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("ID-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("Last Edited-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("Status-header-btn")).toBeInTheDocument(); + }); + + it("should handle DMN name column sorting", async () => { + const sortButton = screen.getByTestId("Name-header-btn"); + fireEvent.click(sortButton); + + await waitFor(() => expect(store.dispatch).toHaveBeenCalled()); + + const dispatchedFunction = store.dispatch.mock.calls[0][0]; + expect(typeof dispatchedFunction).toBe("function"); + + await dispatchedFunction(store.dispatch); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.objectContaining({ + type: "DMN_SORT", + payload: expect.objectContaining({ + activeKey: "name", + name: expect.objectContaining({ sortOrder: "desc" }) + }), + }) + ); + }); + }); + + it('should handle DMN search functionality correctly', async () => { + const searchInput = screen.getByTestId('DMN-search-input'); + await userEvent.type(searchInput, 'test decision'); + + const searchButton = screen.getByRole('button', { name: /search/i }); + fireEvent.click(searchButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith(expect.any(Function)); + }); + }); + + it('should handle DMN clear search correctly', async () => { + const searchInput = screen.getByTestId('DMN-search-input'); + await userEvent.type(searchInput, 'test decision'); + + const clearButton = screen.getByRole('button', { name: /clear/i }); + fireEvent.click(clearButton); + + expect(searchInput.value).toBe(''); + expect(store.dispatch).toHaveBeenCalled(); + }); + +// it('should dispatch action on DMN refresh button click', async () => { +// const refreshButton = screen.getByTestId("Process-list-refresh-dmn"); +// fireEvent.click(refreshButton); + +// await waitFor(() => { +// expect(store.dispatch).toHaveBeenCalledWith(expect.any(Function)); +// }); +// }); + + it("should redirect to DMN edit page when gotoEdit is called", () => { + const dmnItem = mockstate.process.dmnProcessList[0]; + const mockDispatch = jest.fn(); + store.dispatch = mockDispatch; + + const editButton = screen.getByTestId(`edit-button-${dmnItem.processKey}`); + fireEvent.click(editButton); + + waitFor(() => { + expect(mockDispatch).toHaveBeenCalledWith( + expect.objectContaining({ + payload: `/dmn/edit/${dmnItem.processKey}` + }) + ); + }); + }); + it('should handle filter icon click and sort modal interactions', () => { + const filterButton = screen.getByTestId('Process-list-filter-dmn'); + fireEvent.click(filterButton); + + const sortModal = screen.getByTestId('sort-modal'); + expect(sortModal).toBeInTheDocument(); + + const closeButton = screen.getByTestId('sort-modal-close'); + fireEvent.click(closeButton); + expect(sortModal).not.toBeInTheDocument(); + }); + + it('should handle sort modal interactions correctly', async () => { + const filterButton = screen.getByTestId('Process-list-filter-dmn'); + fireEvent.click(filterButton); + + const sortModal = screen.getByTestId('sort-modal'); + expect(sortModal).toBeInTheDocument(); + + const applySortButton = screen.getByTestId('apply-sort-button'); + fireEvent.click(applySortButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.any(Function) + ); + }); + }); + + it('should handle refresh functionality correctly', async () => { + const refreshButton = screen.getByTestId('Process-list-refresh-dmn'); + fireEvent.click(refreshButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.any(Function) + ); + }); + + // Verify refresh action updates the process list + const dispatchedAction = store.dispatch.mock.calls[0][0]; + expect(typeof dispatchedAction).toBe('function'); + }); + +}); diff --git a/forms-flow-web/src/_tests_/unit/BPMN/ProcessTable.test.js b/forms-flow-web/src/_tests_/unit/BPMN/ProcessTable.test.js new file mode 100644 index 0000000000..0f97fb5052 --- /dev/null +++ b/forms-flow-web/src/_tests_/unit/BPMN/ProcessTable.test.js @@ -0,0 +1,245 @@ +import React from "react"; +import { + render as rtlRender, + fireEvent, + waitFor, + screen, +} from "@testing-library/react"; +import userEvent from '@testing-library/user-event'; +import { Provider } from "react-redux"; +import "@testing-library/jest-dom"; +import { configureStore } from "@reduxjs/toolkit"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { createMemoryHistory } from "history"; +import { Router, Route } from "react-router-dom"; +import { Switch } from "react-router-dom/cjs/react-router-dom.min"; +import rootReducer from "../rootReducer"; +import { mockstate } from "../mockState"; +import ProcessTable from "../../../routes/Design/Process/ProcessTable"; + + +jest.mock("connected-react-router", () => ({ + push: jest.fn(), +})); +jest.mock("@formsflow/components", () => ({ + ...jest.requireActual("../../../__mocks__/@formsflow/components"), + FilterIcon: () =>
Filter Icon
, + RefreshIcon: () =>
Refresh Icon
, + SortModal: ({ showSortModal, onClose, primaryBtnAction }) => ( + showSortModal ? ( +
+ + +
+ ) : null + ) +})); + +const queryClient = new QueryClient(); +let store; +let history; + +function renderWithRouterMatch(Ui, { path = "/", route = "/", props = {} }) { + history = createMemoryHistory({ initialEntries: [route] }); + return rtlRender( + + + + + } /> + + + + + ); +} + +describe('ProcessTable Component Tests', () => { + beforeEach(() => { + store = configureStore({ + reducer: rootReducer, + preloadedState: mockstate, + }); + store.dispatch = jest.fn(); + + renderWithRouterMatch(ProcessTable, { + path: "/:viewType", + route: "/subflow", + }); + + store.dispatch.mockClear(); + jest.clearAllMocks(); + }); + + it("should render process table header correctly", () => { + expect(screen.getByTestId("Name-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("ID-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("Last Edited-header-btn")).toBeInTheDocument(); + expect(screen.getByTestId("Status-header-btn")).toBeInTheDocument(); + }); + + it("should handle process name column sorting", async () => { + const currentPath = history.location.pathname; + const viewType = currentPath.split("/")[1]; + const expectedSortType = viewType === "subflow" ? "BPM_SORT" : "DMN_SORT"; + + const sortButton = screen.getByTestId("Name-header-btn"); + fireEvent.click(sortButton); + + await waitFor(() => expect(store.dispatch).toHaveBeenCalled()); + + const dispatchedFunction = store.dispatch.mock.calls[0][0]; + expect(typeof dispatchedFunction).toBe("function"); + + await dispatchedFunction(store.dispatch); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.objectContaining({ + type: expectedSortType, + payload: expect.objectContaining({ + activeKey: "name", + name: expect.objectContaining({ sortOrder: "desc" }), + modified: expect.objectContaining({ sortOrder: "asc" }), + status: expect.objectContaining({ sortOrder: "asc" }), + processKey: expect.objectContaining({ sortOrder: "asc" }), + }), + }) + ); + }); + }); + + it('should handle search functionality correctly', async () => { + const searchInput = screen.getByTestId('BPMN-search-input'); + await userEvent.type(searchInput, 'test process'); + + const searchButton = screen.getByRole('button', { name: /search/i }); + fireEvent.click(searchButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.any(Function) + ); + }); + }); + + it('should handle clear search correctly', async () => { + const searchInput = screen.getByTestId('BPMN-search-input'); + await userEvent.type(searchInput, 'test process'); + + const clearButton = screen.getByRole('button', { name: /clear/i }); + fireEvent.click(clearButton); + + expect(searchInput.value).toBe(''); + expect(store.dispatch).toHaveBeenCalled(); + }); + + + it('should show loading overlay when isLoading is true', () => { + const overlay = screen.getByTestId("overlay"); + const loadingOverlay = screen.getByText('Loading...'); + expect(overlay).toBeInTheDocument(); + expect(loadingOverlay).toBeInTheDocument(); + }); + + it('should render the table footer component and handle pagination correctly', () => { + store.dispatch.mockClear(); + jest.clearAllMocks(); + + const footer = screen.getByTestId("table-footer"); + expect(footer).toBeInTheDocument(); + + const itemsCount = screen.getByTestId("items-count"); + expect(itemsCount).toBeInTheDocument(); + + const totalItems = screen.getByTestId("total-items"); + expect(totalItems).toHaveTextContent('50'); + + const prevButton = screen.getByTestId('left-button'); + const nextButton = screen.getByTestId('right-button'); + expect(prevButton).toBeInTheDocument(); + expect(nextButton).toBeInTheDocument(); + + const pageDisplay = screen.getByTestId('current-page-display'); + expect(pageDisplay).toBeInTheDocument(); + + fireEvent.click(nextButton); + expect(store.dispatch).toHaveBeenCalled(); + + fireEvent.click(prevButton); + expect(store.dispatch).toHaveBeenCalled(); + + const pageSizeDropdown = screen.getByTestId('page-size-dropdown'); + expect(pageSizeDropdown).toBeInTheDocument(); + + fireEvent.change(pageSizeDropdown, { target: { value: "10" } }); + + expect(store.dispatch).toHaveBeenCalled(); + const dispatchedAction = store.dispatch.mock.calls[store.dispatch.mock.calls.length - 1][0]; + expect(typeof dispatchedAction).toBe('function'); + }); + it("should redirect to edit page when gotoEdit is called", () => { + const processItem = mockstate.process.processList[0]; + + // Mock the dispatch function before configuring store + const mockDispatch = jest.fn(); + store.dispatch = mockDispatch; + + // Get the button and trigger click + const editButton = screen.getByTestId(`edit-button-${processItem.processKey}`); + fireEvent.click(editButton); + + // Wait for dispatch to be called + waitFor(() => { + expect(mockDispatch).toHaveBeenCalledWith( + expect.objectContaining({ + payload: `/subflow/edit/${processItem.processKey}` + }) + ); + }); + }); + it('should handle filter icon click and sort modal interactions', () => { + const filterButton = screen.getByTestId('Process-list-filter-bpmn'); + fireEvent.click(filterButton); + + const sortModal = screen.getByTestId('sort-modal'); + expect(sortModal).toBeInTheDocument(); + + const closeButton = screen.getByTestId('sort-modal-close'); + fireEvent.click(closeButton); + expect(sortModal).not.toBeInTheDocument(); + }); + + it('should handle sort modal interactions correctly', async () => { + const filterButton = screen.getByTestId('Process-list-filter-bpmn'); + fireEvent.click(filterButton); + + const sortModal = screen.getByTestId('sort-modal'); + expect(sortModal).toBeInTheDocument(); + + const applySortButton = screen.getByTestId('apply-sort-button'); + fireEvent.click(applySortButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.any(Function) + ); + }); + }); + + it('should handle refresh functionality correctly', async () => { + const refreshButton = screen.getByTestId('Process-list-refresh-bpmn'); + fireEvent.click(refreshButton); + + await waitFor(() => { + expect(store.dispatch).toHaveBeenCalledWith( + expect.any(Function) + ); + }); + + // Verify refresh action updates the process list + const dispatchedAction = store.dispatch.mock.calls[0][0]; + expect(typeof dispatchedAction).toBe('function'); + }); + +}); diff --git a/forms-flow-web/src/_tests_/unit/mockState.js b/forms-flow-web/src/_tests_/unit/mockState.js index 93817599c0..ebd88532f0 100644 --- a/forms-flow-web/src/_tests_/unit/mockState.js +++ b/forms-flow-web/src/_tests_/unit/mockState.js @@ -2,8 +2,75 @@ export const mockstate = { process:{ - processList: [], + isProcessLoading: true, + processStatusList: [], + processLoadError: false, + processXml: "", + processList: [ + { + "created": "2025-02-10T09:01:11.971172Z", + "modified": "2025-02-10T09:01:11.971190Z", + "id": 4676, + "name": "AAA123 asdfas fasdfasdfasdf asdf", + "tenant": null, + "createdBy": "formsflow-designer", + "modifiedBy": null, + "status": "Published", + "processType": "BPMN", + "isSubflow": true, + "processKey": "Process_nm9ewcsAAQQQ", + "parentProcessKey": "Process_nm9ewcsAAQQQ" + } + ], + dmnProcessList: [{ + "created": "2025-02-10T09:00:27.522600Z", + "modified": "2025-02-10T09:00:27.522617Z", + "id": 4674, + "name": "abilaaadddghaagccalexaaaffcxdfvdff", + "tenant": null, + "createdBy": "formsflow-designer", + "modifiedBy": null, + "status": "Draft", + "processType": "DMN", + "isSubflow": true, + "processKey": "abddddlsghaafdantonydsfcvgf", + "parentProcessKey": "ablsghaafdantonydsfcvgf" + }], + formProcessError: false, + formProcessList: [], + formPreviousData: [], + processActivityList: null, + processActivityLoadError: false, + isProcessDiagramLoading: false, + applicationCount: 0, isApplicationCountLoading: false, + applicationCountResponse: false, + unPublishApiError: false, + workflowAssociated: null, //{label:'Workflow Name', value:'workflow_process_key'} + formStatusLoading: false, + authorizationDetails: {}, + formAuthVerifyLoading: false, + isBpmnModel: false, + bpmnSearchText: "", + dmnSearchText: "", + isPublicDiagram: null, + processHistoryData:{}, + totalBpmnCount:50, + totalDmnCount:50, + bpmsort: { + activeKey: "name", + name: { sortOrder: "asc" }, + processKey: { sortOrder: "asc" }, + modified: { sortOrder: "asc" }, + status: { sortOrder: "asc" }, + }, + dmnSort: { + activeKey: "processKey", + name: { sortOrder: "asc" }, + processKey: { sortOrder: "asc" }, + modified: { sortOrder: "asc" }, + status: { sortOrder: "asc" }, + }, processData: { name: "Test Process", status: "Published", @@ -16,7 +83,7 @@ export const mockstate = { error: "", forms: [ { - _id: 'mock-form-id', + _id: 'mock-form-id', title: 'Test Form', description: 'Test Description', status: 'active', @@ -32,7 +99,7 @@ export const mockstate = { formType:"form", searchText: "", sort: { - activeKey: "formName", + activeKey: "formName", formName: { sortOrder: "asc" }, modified: { sortOrder: "asc" }, submissions: { sortOrder: "asc" }, @@ -43,7 +110,7 @@ export const mockstate = { }, user:{ - createDesigns: true, + createDesigns: true, bearerToken: "", roles: [ "view_tasks", @@ -78,7 +145,7 @@ export const mockstate = { "RESOURCE_ID": "65f6845c5a0b7bdb4eabdde1" }, userDetail: {}, - isAuthenticated: false, + isAuthenticated: true, currentPage: "", showApplications: false, lang: localStorage.getItem("lang") ? localStorage.getItem("lang") : null, @@ -104,11 +171,9 @@ export const mockstate = { searchFormLoading: false, designerAccessDenied: false }, - formDelete: { + formDelete: { formDelete: { modalOpen: false, formId: "", formName: "" } - } - - + }, };