summaryrefslogtreecommitdiff
path: root/spec/javascripts/diffs/components/diff_line_note_form_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/diffs/components/diff_line_note_form_spec.js')
-rw-r--r--spec/javascripts/diffs/components/diff_line_note_form_spec.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/javascripts/diffs/components/diff_line_note_form_spec.js b/spec/javascripts/diffs/components/diff_line_note_form_spec.js
index 724d1948214..81cd4f9769a 100644
--- a/spec/javascripts/diffs/components/diff_line_note_form_spec.js
+++ b/spec/javascripts/diffs/components/diff_line_note_form_spec.js
@@ -19,7 +19,15 @@ describe('DiffLineNoteForm', () => {
diffLines,
line: diffLines[0],
noteTargetLine: diffLines[0],
- }).$mount();
+ });
+
+ Object.defineProperty(component, 'isLoggedIn', {
+ get() {
+ return true;
+ },
+ });
+
+ component.$mount();
});
describe('methods', () => {
@@ -56,6 +64,15 @@ describe('DiffLineNoteForm', () => {
});
});
+ describe('mounted', () => {
+ it('should init autosave', () => {
+ const key = 'autosave/Note/issue///DiffNote//1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_1';
+
+ expect(component.autosave).toBeDefined();
+ expect(component.autosave.key).toEqual(key);
+ });
+ });
+
describe('template', () => {
it('should have note form', () => {
const { $el } = component;