Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8ec89b59
Commit
8ec89b59
authored
Oct 25, 2021
by
Jacques
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor blob content viewer spec
Refactored the spec for better maintainability
parent
d850bb85
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
161 additions
and
275 deletions
+161
-275
spec/frontend/repository/components/blob_content_viewer_spec.js
...rontend/repository/components/blob_content_viewer_spec.js
+105
-275
spec/frontend/repository/mock_data.js
spec/frontend/repository/mock_data.js
+56
-0
No files found.
spec/frontend/repository/components/blob_content_viewer_spec.js
View file @
8ec89b59
This diff is collapsed.
Click to expand it.
spec/frontend/repository/mock_data.js
0 → 100644
View file @
8ec89b59
export
const
simpleViewerMock
=
{
name
:
'
some_file.js
'
,
size
:
123
,
rawSize
:
123
,
rawTextBlob
:
'
raw content
'
,
fileType
:
'
text
'
,
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
'
,
canModifyBlob
:
true
,
storedExternally
:
false
,
rawPath
:
'
some_file.js
'
,
replacePath
:
'
some_file.js/replace
'
,
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
=
{
id
:
'
1234
'
,
userPermissions
:
userPermissionsMock
,
pathLocks
:
{
nodes
:
[],
},
repository
:
{
empty
:
false
,
},
};
export
const
propsMock
=
{
path
:
'
some_file.js
'
,
projectPath
:
'
some/path
'
};
export
const
refMock
=
'
default-ref
'
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment