PromucFlow_constructor/app/client/src/pages/tests/mockData.ts
Ankita Kinger 47c09cef92
chore: Code splitting FE files to support app level invites on Business edition (#21783)
## Description

> Code splitting FE files to support app level invites on Business
edition.

Fixes [#21018](https://github.com/appsmithorg/appsmith/issues/21018)
[#21015](https://github.com/appsmithorg/appsmith/issues/21015)

## Type of change

- Chore (housekeeping or task changes that don't impact user perception)


## How Has This Been Tested?
> Nothing is affected on CE by this change.

- Manual

## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-29 17:07:06 +00:00

94 lines
2.1 KiB
TypeScript

import type { FetchApplicationResponse } from "@appsmith/api/ApplicationApi";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import store from "store";
export const fetchPagesMockResponse = {
responseMeta: {
status: 200,
success: true,
},
data: {
workspaceId: "605c433c91dea93f0eaf91b5",
pages: [
{
pageId: "605c435a91dea93f0eaf91ba",
name: "Page1",
isDefault: true,
slug: "page-1",
},
],
},
};
export const fetchApplicationMockResponse: FetchApplicationResponse = {
responseMeta: {
status: 200,
success: true,
},
data: {
application: {
id: "605c435a91dea93f0eaf91b8",
name: "My Application",
slug: "my-application",
workspaceId: "",
evaluationVersion: 1,
appIsExample: false,
gitApplicationMetadata: undefined,
applicationVersion: 2,
},
pages: [
{
id: "605c435a91dea93f0eaf91ba",
name: "Page1",
isDefault: true,
slug: "page-1",
},
{
id: "605c435a91dea93f0eaf91bc",
name: "Page2",
isDefault: false,
slug: "page-2",
},
],
workspaceId: "",
},
};
export const setMockPageList = () => {
store.dispatch({
type: ReduxActionTypes.FETCH_PAGE_LIST_SUCCESS,
payload: {
applicationId: "605c435a91dea93f0eaf91b8",
pages: fetchPagesMockResponse.data.pages,
},
});
};
export const setMockApplication = () => {
store.dispatch({
type: ReduxActionTypes.FETCH_APPLICATION_SUCCESS,
payload: {
...fetchApplicationMockResponse.data.application,
pages: fetchApplicationMockResponse.data.pages,
},
});
};
export const updatedApplicationPayload = {
id: "605c435a91dea93f0eaf91b8",
name: "Renamed application",
slug: "renamed-application",
workspaceId: "",
evaluationVersion: 1,
appIsExample: false,
gitApplicationMetadata: undefined,
applicationVersion: 2,
};
export const updatedPagePayload = {
id: "605c435a91dea93f0eaf91bc",
name: "My Page 2",
isDefault: false,
slug: "my-page-2",
};