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
9d992703
Commit
9d992703
authored
Oct 19, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unwrapped snippet_edit from DOMContentLoaded handler
Also removed the redundant Jest spec
parent
33f30296
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
33 deletions
+4
-33
app/assets/javascripts/snippet/snippet_edit.js
app/assets/javascripts/snippet/snippet_edit.js
+4
-5
app/assets/javascripts/snippets/index.js
app/assets/javascripts/snippets/index.js
+0
-8
spec/frontend/snippet/snippet_edit_spec.js
spec/frontend/snippet/snippet_edit_spec.js
+0
-20
No files found.
app/assets/javascripts/snippet/snippet_edit.js
View file @
9d992703
import
ZenMode
from
'
~/zen_mode
'
;
import
{
SnippetEditInit
}
from
'
~/snippets
'
;
import
SnippetsEdit
from
'
~/snippets/components/edit.vue
'
;
import
SnippetsAppFactory
from
'
~/snippets
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
SnippetEditInit
();
new
ZenMode
();
// eslint-disable-line no-new
});
SnippetsAppFactory
(
document
.
getElementById
(
'
js-snippet-edit
'
),
SnippetsEdit
);
new
ZenMode
();
// eslint-disable-line no-new
app/assets/javascripts/snippets/index.js
View file @
9d992703
...
...
@@ -44,11 +44,3 @@ export default function appFactory(el, Component) {
},
});
}
export
const
SnippetEditInit
=
()
=>
{
import
(
'
./components/edit.vue
'
)
.
then
(({
default
:
SnippetsEdit
})
=>
{
appFactory
(
document
.
getElementById
(
'
js-snippet-edit
'
),
SnippetsEdit
);
})
.
catch
(()
=>
{});
};
spec/frontend/snippet/snippet_edit_spec.js
deleted
100644 → 0
View file @
33f30296
import
'
~/snippet/snippet_edit
'
;
import
{
triggerDOMEvent
}
from
'
jest/helpers/dom_events_helper
'
;
import
{
SnippetEditInit
}
from
'
~/snippets
'
;
jest
.
mock
(
'
~/snippets
'
);
jest
.
mock
(
'
~/gl_form
'
);
describe
(
'
Snippet edit form initialization
'
,
()
=>
{
beforeEach
(()
=>
{
setFixtures
(
'
<div class="snippet-form"></div>
'
);
});
it
(
'
correctly initializes Vue Snippet Edit form
'
,
()
=>
{
SnippetEditInit
.
mockClear
();
triggerDOMEvent
(
'
DOMContentLoaded
'
);
expect
(
SnippetEditInit
).
toHaveBeenCalled
();
});
});
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