summaryrefslogtreecommitdiff
path: root/spec/frontend/repository/components/table/row_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/repository/components/table/row_spec.js')
-rw-r--r--spec/frontend/repository/components/table/row_spec.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js
index 216128dce25..6b4508c418e 100644
--- a/spec/frontend/repository/components/table/row_spec.js
+++ b/spec/frontend/repository/components/table/row_spec.js
@@ -29,9 +29,10 @@ describe('Repository table row component', () => {
it('renders table row', () => {
factory({
- id: 1,
+ id: '1',
path: 'test',
type: 'file',
+ currentPath: '/',
});
expect(vm.element).toMatchSnapshot();
@@ -39,14 +40,15 @@ describe('Repository table row component', () => {
it.each`
type | component | componentName
- ${'folder'} | ${RouterLinkStub} | ${'RouterLink'}
+ ${'tree'} | ${RouterLinkStub} | ${'RouterLink'}
${'file'} | ${'a'} | ${'hyperlink'}
${'commit'} | ${'a'} | ${'hyperlink'}
`('renders a $componentName for type $type', ({ type, component }) => {
factory({
- id: 1,
+ id: '1',
path: 'test',
type,
+ currentPath: '/',
});
expect(vm.find(component).exists()).toBe(true);
@@ -54,14 +56,15 @@ describe('Repository table row component', () => {
it.each`
type | pushes
- ${'folder'} | ${true}
+ ${'tree'} | ${true}
${'file'} | ${false}
${'commit'} | ${false}
- `('pushes new router if type $type is folder', ({ type, pushes }) => {
+ `('pushes new router if type $type is tree', ({ type, pushes }) => {
factory({
- id: 1,
+ id: '1',
path: 'test',
type,
+ currentPath: '/',
});
vm.trigger('click');
@@ -75,9 +78,10 @@ describe('Repository table row component', () => {
it('renders commit ID for submodule', () => {
factory({
- id: 1,
+ id: '1',
path: 'test',
type: 'commit',
+ currentPath: '/',
});
expect(vm.find('.commit-sha').text()).toContain('1');