Skip to content

Commit

Permalink
updated mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Jul 12, 2024
1 parent c87ac51 commit 5ffa54d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 1 addition & 3 deletions src/containers/Flow/Flow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mocks = [
...getOrganizationQuery,
getFlowQuery({ id: 1 }),
getFlowQuery({ id: '1' }),
filterFlowQuery,
filterFlowQuery({ isActive: true, isTemplate: false }),
getFilterTagQuery,
getRoleNameQuery,
getOrganizationLanguagesQuery,
Expand Down Expand Up @@ -261,8 +261,6 @@ it('buttons should be disabled in template state', async () => {
expect(screen.getByText('Edit flow')).toBeInTheDocument();
});

screen.debug(document, Infinity);

await waitFor(() => {
expect(screen.getByTestId('submitActionButton')).toBeDisabled();
expect(screen.getByTestId('remove-icon')).toBeDisabled();
Expand Down
18 changes: 10 additions & 8 deletions src/containers/Flow/FlowList/FlowList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ import { Flow } from '../Flow';
import { getFilterTagQuery } from 'mocks/Tag';
import { getRoleNameQuery } from 'mocks/Role';

const isActiveFilter = { isActive: true, isTemplate: false };

const mocks = [
getFlowCountQuery({ isActive: true, isTemplate: false }),
getFlowCountQuery({ isActive: true, isTemplate: false }),
getFlowCountQuery({ isActive: true, isTemplate: false }),
getFlowCountQuery({ isActive: true, isTemplate: false }),
filterFlowQuery,
filterFlowQuery,
filterFlowQuery,
filterFlowQuery,
getFlowCountQuery(isActiveFilter),
getFlowCountQuery(isActiveFilter),
getFlowCountQuery(isActiveFilter),
getFlowCountQuery(isActiveFilter),
filterFlowQuery(isActiveFilter),
filterFlowQuery(isActiveFilter),
filterFlowQuery(isActiveFilter),
filterFlowQuery(isActiveFilter),
filterFlowNewQuery,
getFlowCountNewQuery,
getFlowQuery({ id: 1 }),
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Form/FormLayout.test.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export const LIST_ITEM_MOCKS = [
...getOrganizationQuery,
getOrganizationLanguagesQuery,
getFlowQuery({ id: 1 }),
filterFlowQuery,
filterFlowQuery,
filterFlowQuery({ isActive: true, isTemplate: false }),
filterFlowQuery({ isActive: true, isTemplate: false }),
getFlowCountQuery({ isTemplate: false, isActive: true }),
getFlowCountQuery({ isTemplate: false, isActive: true }),
getFilterTagQuery,
Expand Down
8 changes: 4 additions & 4 deletions src/containers/List/List.test.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export const defaultProps = {

export const LIST_MOCKS = [
getCurrentUserQuery,
filterFlowQuery,
getFlowCountQuery({ isTemplate: false, isActive: true }),
filterFlowQuery,
filterFlowQuery({ isActive: true }),
getFlowCountQuery({ isActive: true }),
filterFlowQuery({ isActive: true }),
filterFlowSortQuery,
getFlowCountQuery({ isTemplate: false, isActive: true }),
getFlowCountQuery({ isActive: true }),
filterFlowWithNameOrKeywordOrTagQuery,
getFlowCountWithFilterQuery,
getCurrentUserQuery,
Expand Down
6 changes: 3 additions & 3 deletions src/mocks/Flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ const filterFlowResult = {
},
};

export const filterFlowQuery = {
export const filterFlowQuery = (filter: any) => ({
request: {
query: FILTER_FLOW,
variables: {
filter: { isActive: true, isTemplate: false },
filter,
opts: {
limit: 50,
offset: 0,
Expand All @@ -189,7 +189,7 @@ export const filterFlowQuery = {
},

result: filterFlowResult,
};
});

export const filterTemplateFlows = {
request: {
Expand Down

0 comments on commit 5ffa54d

Please sign in to comment.