debian-mirror-gitlab/spec/frontend/repository/mock_data.js

92 lines
1.9 KiB
JavaScript
Raw Normal View History

2021-12-11 22:18:48 +05:30
export const simpleViewerMock = {
2022-01-26 12:08:38 +05:30
id: '1',
2021-12-11 22:18:48 +05:30
name: 'some_file.js',
size: 123,
rawSize: 123,
rawTextBlob: 'raw content',
fileType: 'text',
2022-04-04 11:22:00 +05:30
language: 'javascript',
2021-12-11 22:18:48 +05:30
path: 'some_file.js',
webPath: 'some_file.js',
editBlobPath: 'some_file.js/edit',
ideEditPath: 'some_file.js/ide/edit',
forkAndEditPath: 'some_file.js/fork/edit',
ideForkAndEditPath: 'some_file.js/fork/ide',
2022-04-04 11:22:00 +05:30
environmentFormattedExternalUrl: '',
environmentExternalUrlForRouteMap: '',
2021-12-11 22:18:48 +05:30
canModifyBlob: true,
2022-01-26 12:08:38 +05:30
canCurrentUserPushToBranch: true,
2022-03-02 08:16:31 +05:30
archived: false,
2021-12-11 22:18:48 +05:30
storedExternally: false,
2022-04-04 11:22:00 +05:30
externalStorageUrl: '',
2022-03-02 08:16:31 +05:30
externalStorage: 'lfs',
2021-12-11 22:18:48 +05:30
rawPath: 'some_file.js',
replacePath: 'some_file.js/replace',
pipelineEditorPath: '',
simpleViewer: {
fileType: 'text',
tooLarge: false,
type: 'simple',
renderError: null,
},
richViewer: null,
};
export const richViewerMock = {
...simpleViewerMock,
richViewer: {
fileType: 'markup',
tooLarge: false,
type: 'rich',
renderError: null,
},
};
export const userPermissionsMock = {
pushCode: true,
forkProject: true,
downloadCode: true,
createMergeRequestIn: true,
};
export const projectMock = {
2022-04-04 11:22:00 +05:30
__typename: 'Project',
2021-12-11 22:18:48 +05:30
id: '1234',
userPermissions: userPermissionsMock,
pathLocks: {
2022-01-26 12:08:38 +05:30
nodes: [
{
id: 'test',
2022-03-02 08:16:31 +05:30
path: 'locked_file.js',
2022-01-26 12:08:38 +05:30
user: { id: '123', username: 'root' },
},
],
2021-12-11 22:18:48 +05:30
},
repository: {
empty: false,
},
};
export const propsMock = { path: 'some_file.js', projectPath: 'some/path' };
export const refMock = 'default-ref';
2022-03-02 08:16:31 +05:30
export const blobControlsDataMock = {
id: '1234',
repository: {
blobs: {
nodes: [
{
id: '5678',
findFilePath: 'find/file.js',
blamePath: 'blame/file.js',
historyPath: 'history/file.js',
permalinkPath: 'permalink/file.js',
storedExternally: false,
externalStorage: '',
},
],
},
},
};