summaryrefslogtreecommitdiff
path: root/spec/frontend/diffs/components/inline_diff_table_row_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/diffs/components/inline_diff_table_row_spec.js')
-rw-r--r--spec/frontend/diffs/components/inline_diff_table_row_spec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/frontend/diffs/components/inline_diff_table_row_spec.js b/spec/frontend/diffs/components/inline_diff_table_row_spec.js
index 28b3055b58c..66b63a7a1d0 100644
--- a/spec/frontend/diffs/components/inline_diff_table_row_spec.js
+++ b/spec/frontend/diffs/components/inline_diff_table_row_spec.js
@@ -3,6 +3,7 @@ import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue';
import { mapInline } from '~/diffs/components/diff_row_utils';
import InlineDiffTableRow from '~/diffs/components/inline_diff_table_row.vue';
import { createStore } from '~/mr_notes/stores';
+import { findInteropAttributes } from '../find_interop_attributes';
import discussionsMockData from '../mock_data/diff_discussions';
import diffFileMockData from '../mock_data/diff_file';
@@ -310,4 +311,16 @@ describe('InlineDiffTableRow', () => {
});
});
});
+
+ describe('interoperability', () => {
+ it.each`
+ desc | line | expectation
+ ${'with type old'} | ${{ ...thisLine, type: 'old', old_line: 3, new_line: 5 }} | ${{ type: 'old', line: '3', oldLine: '3', newLine: '5' }}
+ ${'with type new'} | ${{ ...thisLine, type: 'new', old_line: 3, new_line: 5 }} | ${{ type: 'new', line: '5', oldLine: '3', newLine: '5' }}
+ `('$desc, sets interop data attributes', ({ line, expectation }) => {
+ createComponent({ line });
+
+ expect(findInteropAttributes(wrapper)).toEqual(expectation);
+ });
+ });
});