This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix e2e error after graphql refactor (#451)
- Loading branch information
Showing
22 changed files
with
146 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tools/e2e-testing/helpers/converter/blockCommitConverter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { BlockCommitInput } from '@/helpers/types/graphql.types' | ||
import { PageBlock } from '@/helpers/types/data.types' | ||
import { generateUUID } from '@/helpers/utils/uuid' | ||
|
||
export function blockCommitConverter(page: PageBlock, id: string): BlockCommitInput { | ||
return { | ||
input: { | ||
documentId: id, | ||
blockId: id, | ||
// hard code temporary until backend be fixed | ||
operatorId: '54701a5a-f151-499f-8cc3-069950144ad3', | ||
stateType: 'full', | ||
state: page.state ?? '', | ||
stateId: generateUUID(), | ||
statesCount: 1, | ||
meta: { | ||
title: page.title, | ||
icon: page.icon | ||
? { | ||
__typename: 'BlockEmoji', | ||
type: 'EMOJI', | ||
name: page.icon.name, | ||
emoji: page.icon.emoji | ||
} | ||
: undefined | ||
}, | ||
content: { | ||
type: 'doc', | ||
content: [] | ||
} | ||
} | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
tools/e2e-testing/helpers/converter/blockSyncBatchConverter.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { CreateBlockInput } from '@/helpers/types/graphql.types' | ||
import { PageBlock } from '@/helpers/types/data.types' | ||
|
||
export function createBlockConverter(page: PageBlock, parentId?: string): CreateBlockInput { | ||
export function createBlockConverter(page: PageBlock, username: string, parentId?: string): CreateBlockInput { | ||
return { | ||
input: { | ||
parentId, | ||
title: page.title | ||
title: page.title, | ||
username | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export interface PageBlock { | ||
id?: string | ||
title: string | ||
// find in packages/uploader/src/Dashboard/data-by-group.json | ||
// Find in packages/uploader/src/Dashboard/data-by-group.json | ||
icon?: { name: string; emoji: string } | ||
children?: PageBlock[] | ||
// In dev environment, generated by window.debugDumpDocumentState() | ||
state?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { PageType } from '../types/graphql.types' | ||
|
||
export function compareAttributeItem(item1: PageType, item2: PageType): number { | ||
const text1 = item1.text.toLowerCase().trim() | ||
const text2 = item2.text.toLowerCase().trim() | ||
return text2.localeCompare(text1) | ||
const title1 = item1.documentInfo.title.toLowerCase().trim() | ||
const title2 = item2.documentInfo.title.toLowerCase().trim() | ||
return title2.localeCompare(title1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as crypto from 'crypto' | ||
|
||
export const generateUUID = (): string => { | ||
return crypto.randomUUID() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.