2023-06-20 00:43:36 +05:30
export const designListQueryResponseNodes = [
{
_ _typename : 'Design' ,
id : '1' ,
event : 'NONE' ,
filename : 'fox_1.jpg' ,
notesCount : 3 ,
image : 'image-1' ,
imageV432x230 : 'image-1' ,
currentUserTodos : {
_ _typename : 'ToDo' ,
nodes : [ ] ,
} ,
} ,
{
_ _typename : 'Design' ,
id : '2' ,
event : 'NONE' ,
filename : 'fox_2.jpg' ,
notesCount : 2 ,
image : 'image-2' ,
imageV432x230 : 'image-2' ,
currentUserTodos : {
_ _typename : 'ToDo' ,
nodes : [ ] ,
} ,
} ,
{
_ _typename : 'Design' ,
id : '3' ,
event : 'NONE' ,
filename : 'fox_3.jpg' ,
notesCount : 1 ,
image : 'image-3' ,
imageV432x230 : 'image-3' ,
currentUserTodos : {
_ _typename : 'ToDo' ,
nodes : [ ] ,
} ,
} ,
] ;
export const getDesignListQueryResponse = ( {
versions = [ ] ,
designs = designListQueryResponseNodes ,
} = { } ) => ( {
2020-10-24 23:57:45 +05:30
data : {
project : {
2021-01-29 00:20:46 +05:30
_ _typename : 'Project' ,
2020-10-24 23:57:45 +05:30
id : '1' ,
issue : {
2021-01-29 00:20:46 +05:30
_ _typename : 'Issue' ,
2022-01-26 12:08:38 +05:30
id : 'issue-1' ,
2020-10-24 23:57:45 +05:30
designCollection : {
2021-01-29 00:20:46 +05:30
_ _typename : 'DesignCollection' ,
2021-01-03 14:25:43 +05:30
copyState : 'READY' ,
2020-10-24 23:57:45 +05:30
designs : {
2021-01-29 00:20:46 +05:30
_ _typename : 'DesignConnection' ,
2023-06-20 00:43:36 +05:30
nodes : designs ,
2020-10-24 23:57:45 +05:30
} ,
versions : {
2023-06-20 00:43:36 +05:30
_ _typename : 'DesignVersionConnection' ,
nodes : versions ,
2020-10-24 23:57:45 +05:30
} ,
} ,
} ,
} ,
} ,
2023-06-20 00:43:36 +05:30
} ) ;
2020-10-24 23:57:45 +05:30
2021-01-03 14:25:43 +05:30
export const designUploadMutationCreatedResponse = {
data : {
designManagementUpload : {
designs : [
{
id : '1' ,
event : 'CREATION' ,
filename : 'fox_1.jpg' ,
} ,
] ,
} ,
} ,
} ;
export const designUploadMutationUpdatedResponse = {
data : {
designManagementUpload : {
designs : [
{
id : '1' ,
event : 'MODIFICATION' ,
filename : 'fox_1.jpg' ,
} ,
] ,
} ,
} ,
} ;
2023-05-27 22:25:52 +05:30
export const getPermissionsQueryResponse = ( createDesign = true ) => ( {
2020-10-24 23:57:45 +05:30
data : {
project : {
2021-01-29 00:20:46 +05:30
_ _typename : 'Project' ,
2020-10-24 23:57:45 +05:30
id : '1' ,
issue : {
2021-01-29 00:20:46 +05:30
_ _typename : 'Issue' ,
2022-01-26 12:08:38 +05:30
id : 'issue-1' ,
2023-05-27 22:25:52 +05:30
userPermissions : { _ _typename : 'UserPermissions' , createDesign } ,
2020-10-24 23:57:45 +05:30
} ,
} ,
} ,
2023-05-27 22:25:52 +05:30
} ) ;
2020-10-24 23:57:45 +05:30
export const reorderedDesigns = [
{
2021-01-29 00:20:46 +05:30
_ _typename : 'Design' ,
2020-10-24 23:57:45 +05:30
id : '2' ,
event : 'NONE' ,
filename : 'fox_2.jpg' ,
notesCount : 2 ,
image : 'image-2' ,
imageV432x230 : 'image-2' ,
2020-11-24 15:15:51 +05:30
currentUserTodos : {
2021-01-29 00:20:46 +05:30
_ _typename : 'ToDo' ,
2020-11-24 15:15:51 +05:30
nodes : [ ] ,
} ,
2020-10-24 23:57:45 +05:30
} ,
{
2021-01-29 00:20:46 +05:30
_ _typename : 'Design' ,
2020-10-24 23:57:45 +05:30
id : '1' ,
event : 'NONE' ,
filename : 'fox_1.jpg' ,
notesCount : 3 ,
image : 'image-1' ,
imageV432x230 : 'image-1' ,
2020-11-24 15:15:51 +05:30
currentUserTodos : {
2021-01-29 00:20:46 +05:30
_ _typename : 'ToDo' ,
2020-11-24 15:15:51 +05:30
nodes : [ ] ,
} ,
2020-10-24 23:57:45 +05:30
} ,
{
2021-01-29 00:20:46 +05:30
_ _typename : 'Design' ,
2020-10-24 23:57:45 +05:30
id : '3' ,
event : 'NONE' ,
filename : 'fox_3.jpg' ,
notesCount : 1 ,
image : 'image-3' ,
imageV432x230 : 'image-3' ,
2020-11-24 15:15:51 +05:30
currentUserTodos : {
2021-01-29 00:20:46 +05:30
_ _typename : 'ToDo' ,
2020-11-24 15:15:51 +05:30
nodes : [ ] ,
} ,
2020-10-24 23:57:45 +05:30
} ,
] ;
export const moveDesignMutationResponse = {
data : {
designManagementMove : {
designCollection : {
2021-01-29 00:20:46 +05:30
_ _typename : 'DesignCollection' ,
2020-10-24 23:57:45 +05:30
designs : {
2021-01-29 00:20:46 +05:30
_ _typename : 'DesignConnection' ,
2020-10-24 23:57:45 +05:30
nodes : [ ... reorderedDesigns ] ,
} ,
} ,
errors : [ ] ,
} ,
} ,
} ;
export const moveDesignMutationResponseWithErrors = {
data : {
designManagementMove : {
designCollection : {
designs : {
nodes : [ ... reorderedDesigns ] ,
} ,
} ,
errors : [ 'Houston, we have a problem' ] ,
} ,
} ,
} ;
2021-10-27 15:23:28 +05:30
export const resolveCommentMutationResponse = {
discussionToggleResolve : {
discussion : {
noteable : {
id : 'gid://gitlab/DesignManagement::Design/1' ,
currentUserTodos : {
nodes : [ ] ,
_ _typename : 'TodoConnection' ,
} ,
_ _typename : 'Design' ,
} ,
_ _typename : 'Discussion' ,
} ,
errors : [ ] ,
_ _typename : 'DiscussionToggleResolvePayload' ,
} ,
} ;
export const getDesignQueryResponse = {
project : {
issue : {
designCollection : {
designs : {
nodes : [
{
id : 'gid://gitlab/DesignManagement::Design/1' ,
currentUserTodos : {
nodes : [ { id : 'gid://gitlab/Todo::1' } ] ,
} ,
} ,
] ,
} ,
} ,
} ,
} ,
} ;
2023-05-27 22:25:52 +05:30
2023-06-20 00:43:36 +05:30
export const mockNoteSubmitSuccessMutationResponse = {
data : {
createNote : {
note : {
id : 'gid://gitlab/DiffNote/468' ,
author : {
id : 'gid://gitlab/User/1' ,
avatarUrl :
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon' ,
name : 'Administrator' ,
username : 'root' ,
webUrl : 'http://127.0.0.1:3000/root' ,
_ _typename : 'UserCore' ,
} ,
body : 'New comment' ,
bodyHtml : "<p data-sourcepos='1:1-1:4' dir='auto'>asdd</p>" ,
createdAt : '2023-02-24T06:49:20Z' ,
resolved : false ,
position : {
diffRefs : {
baseSha : 'f63ae53ed82d8765477c191383e1e6a000c10375' ,
startSha : 'f63ae53ed82d8765477c191383e1e6a000c10375' ,
headSha : 'f348c652f1a737151fc79047895e695fbe81464c' ,
_ _typename : 'DiffRefs' ,
2023-05-27 22:25:52 +05:30
} ,
2023-06-20 00:43:36 +05:30
x : 441 ,
y : 128 ,
height : 152 ,
width : 695 ,
_ _typename : 'DiffPosition' ,
} ,
userPermissions : {
adminNote : true ,
repositionNote : true ,
_ _typename : 'NotePermissions' ,
} ,
discussion : {
id : 'gid://gitlab/Discussion/6466a72f35b163f3c3e52d7976a09387f2c573e8' ,
notes : {
nodes : [
{
id : 'gid://gitlab/DiffNote/459' ,
_ _typename : 'Note' ,
} ,
] ,
_ _typename : 'NoteConnection' ,
2023-05-27 22:25:52 +05:30
} ,
2023-06-20 00:43:36 +05:30
_ _typename : 'Discussion' ,
2023-05-27 22:25:52 +05:30
} ,
2023-06-20 00:43:36 +05:30
_ _typename : 'Note' ,
2023-05-27 22:25:52 +05:30
} ,
2023-06-20 00:43:36 +05:30
errors : [ ] ,
_ _typename : 'CreateNotePayload' ,
2023-05-27 22:25:52 +05:30
} ,
} ,
2023-06-20 00:43:36 +05:30
} ;
2023-05-27 22:25:52 +05:30
export const mockNoteSubmitFailureMutationResponse = [
{
errors : [
{
message :
'Variable $input of type CreateNoteInput! was provided invalid value for bodyaa (Field is not defined on CreateNoteInput), body (Expected value to not be null)' ,
locations : [
{
line : 1 ,
column : 21 ,
} ,
] ,
extensions : {
value : {
noteableId : 'gid://gitlab/DesignManagement::Design/10' ,
discussionId : 'gid://gitlab/Discussion/6466a72f35b163f3c3e52d7976a09387f2c573e8' ,
bodyaa : 'df' ,
} ,
problems : [
{
path : [ 'bodyaa' ] ,
explanation : 'Field is not defined on CreateNoteInput' ,
} ,
{
path : [ 'body' ] ,
explanation : 'Expected value to not be null' ,
} ,
] ,
} ,
} ,
] ,
} ,
] ;
export const mockCreateImageNoteDiffResponse = {
data : {
createImageDiffNote : {
note : {
author : {
username : '' ,
} ,
discussion : { } ,
} ,
} ,
} ,
} ;