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
b21a1d08
Commit
b21a1d08
authored
Aug 09, 2021
by
Simon Knox
Committed by
Vitaly Slobodin
Aug 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "jest-as-if-foss 2/2 failing" [RUN AS-IF-FOSS]
parent
a87a3d2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
15 deletions
+68
-15
ee/spec/frontend/repository/components/blob_button_group_spec.js
.../frontend/repository/components/blob_button_group_spec.js
+68
-0
spec/frontend/repository/components/blob_button_group_spec.js
.../frontend/repository/components/blob_button_group_spec.js
+0
-15
No files found.
ee/spec/frontend/repository/components/blob_button_group_spec.js
0 → 100644
View file @
b21a1d08
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
LockButton
from
'
ee_component/repository/components/lock_button.vue
'
;
import
BlobButtonGroup
from
'
~/repository/components/blob_button_group.vue
'
;
const
DEFAULT_PROPS
=
{
name
:
'
some name
'
,
path
:
'
some/path
'
,
canPushCode
:
true
,
replacePath
:
'
some/replace/path
'
,
deletePath
:
'
some/delete/path
'
,
emptyRepo
:
false
,
projectPath
:
'
some/project/path
'
,
isLocked
:
false
,
canLock
:
true
,
};
const
DEFAULT_INJECT
=
{
glFeatures
:
{
fileLocks
:
true
},
targetBranch
:
'
master
'
,
originalBranch
:
'
master
'
,
};
describe
(
'
EE BlobButtonGroup component
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
BlobButtonGroup
,
{
propsData
:
{
...
DEFAULT_PROPS
,
...
props
,
},
provide
:
{
...
DEFAULT_INJECT
,
},
});
};
const
findLockButton
=
()
=>
wrapper
.
findComponent
(
LockButton
);
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders component
'
,
()
=>
{
const
{
name
,
path
}
=
DEFAULT_PROPS
;
expect
(
wrapper
.
props
()).
toMatchObject
({
name
,
path
,
});
});
it
(
'
renders the lock button
'
,
()
=>
{
expect
(
findLockButton
().
exists
()).
toBe
(
true
);
expect
(
findLockButton
().
props
()).
toMatchObject
({
canLock
:
true
,
isLocked
:
false
,
name
:
'
some name
'
,
path
:
'
some/path
'
,
projectPath
:
'
some/project/path
'
,
});
});
});
spec/frontend/repository/components/blob_button_group_spec.js
View file @
b21a1d08
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
LockButton
from
'
ee_component/repository/components/lock_button.vue
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
BlobButtonGroup
from
'
~/repository/components/blob_button_group.vue
'
;
import
BlobButtonGroup
from
'
~/repository/components/blob_button_group.vue
'
;
import
DeleteBlobModal
from
'
~/repository/components/delete_blob_modal.vue
'
;
import
DeleteBlobModal
from
'
~/repository/components/delete_blob_modal.vue
'
;
...
@@ -19,7 +18,6 @@ const DEFAULT_PROPS = {
...
@@ -19,7 +18,6 @@ const DEFAULT_PROPS = {
};
};
const
DEFAULT_INJECT
=
{
const
DEFAULT_INJECT
=
{
glFeatures
:
{
fileLocks
:
true
},
targetBranch
:
'
master
'
,
targetBranch
:
'
master
'
,
originalBranch
:
'
master
'
,
originalBranch
:
'
master
'
,
};
};
...
@@ -49,7 +47,6 @@ describe('BlobButtonGroup component', () => {
...
@@ -49,7 +47,6 @@ describe('BlobButtonGroup component', () => {
const
findDeleteBlobModal
=
()
=>
wrapper
.
findComponent
(
DeleteBlobModal
);
const
findDeleteBlobModal
=
()
=>
wrapper
.
findComponent
(
DeleteBlobModal
);
const
findUploadBlobModal
=
()
=>
wrapper
.
findComponent
(
UploadBlobModal
);
const
findUploadBlobModal
=
()
=>
wrapper
.
findComponent
(
UploadBlobModal
);
const
findReplaceButton
=
()
=>
wrapper
.
find
(
'
[data-testid="replace"]
'
);
const
findReplaceButton
=
()
=>
wrapper
.
find
(
'
[data-testid="replace"]
'
);
const
findLockButton
=
()
=>
wrapper
.
findComponent
(
LockButton
);
it
(
'
renders component
'
,
()
=>
{
it
(
'
renders component
'
,
()
=>
{
createComponent
();
createComponent
();
...
@@ -67,18 +64,6 @@ describe('BlobButtonGroup component', () => {
...
@@ -67,18 +64,6 @@ describe('BlobButtonGroup component', () => {
createComponent
();
createComponent
();
});
});
it
(
'
renders the lock button
'
,
()
=>
{
expect
(
findLockButton
().
exists
()).
toBe
(
true
);
expect
(
findLockButton
().
props
()).
toMatchObject
({
canLock
:
true
,
isLocked
:
false
,
name
:
'
some name
'
,
path
:
'
some/path
'
,
projectPath
:
'
some/project/path
'
,
});
});
it
(
'
renders both the replace and delete button
'
,
()
=>
{
it
(
'
renders both the replace and delete button
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlButton
)).
toHaveLength
(
2
);
expect
(
wrapper
.
findAll
(
GlButton
)).
toHaveLength
(
2
);
});
});
...
...
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