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
96b92623
Commit
96b92623
authored
Mar 27, 2020
by
Nicolò Maria Mezzopera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tag cell class on mobile vieport
- fix tag class - adjust unit tests
parent
c5e82147
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
2 deletions
+63
-2
app/assets/javascripts/registry/explorer/pages/details.vue
app/assets/javascripts/registry/explorer/pages/details.vue
+2
-1
spec/frontend/registry/explorer/pages/details_spec.js
spec/frontend/registry/explorer/pages/details_spec.js
+61
-1
No files found.
app/assets/javascripts/registry/explorer/pages/details.vue
View file @
96b92623
...
@@ -77,9 +77,10 @@ export default {
...
@@ -77,9 +77,10 @@ export default {
return
name
;
return
name
;
},
},
fields
()
{
fields
()
{
const
tagClass
=
this
.
isDesktop
?
'
w-25
'
:
''
;
return
[
return
[
{
key
:
LIST_KEY_CHECKBOX
,
label
:
''
,
class
:
'
gl-w-16
'
},
{
key
:
LIST_KEY_CHECKBOX
,
label
:
''
,
class
:
'
gl-w-16
'
},
{
key
:
LIST_KEY_TAG
,
label
:
LIST_LABEL_TAG
,
class
:
'
w-25
'
},
{
key
:
LIST_KEY_TAG
,
label
:
LIST_LABEL_TAG
,
class
:
`
${
tagClass
}
js-tag-column`
},
{
key
:
LIST_KEY_IMAGE_ID
,
label
:
LIST_LABEL_IMAGE_ID
},
{
key
:
LIST_KEY_IMAGE_ID
,
label
:
LIST_LABEL_IMAGE_ID
},
{
key
:
LIST_KEY_SIZE
,
label
:
LIST_LABEL_SIZE
},
{
key
:
LIST_KEY_SIZE
,
label
:
LIST_LABEL_SIZE
},
{
key
:
LIST_KEY_LAST_UPDATED
,
label
:
LIST_LABEL_LAST_UPDATED
},
{
key
:
LIST_KEY_LAST_UPDATED
,
label
:
LIST_LABEL_LAST_UPDATED
},
...
...
spec/frontend/registry/explorer/pages/details_spec.js
View file @
96b92623
...
@@ -29,10 +29,11 @@ describe('Details Page', () => {
...
@@ -29,10 +29,11 @@ describe('Details Page', () => {
const
findAllDeleteButtons
=
()
=>
wrapper
.
findAll
(
'
.js-delete-registry
'
);
const
findAllDeleteButtons
=
()
=>
wrapper
.
findAll
(
'
.js-delete-registry
'
);
const
findAllCheckboxes
=
()
=>
wrapper
.
findAll
(
'
.js-row-checkbox
'
);
const
findAllCheckboxes
=
()
=>
wrapper
.
findAll
(
'
.js-row-checkbox
'
);
const
findCheckedCheckboxes
=
()
=>
findAllCheckboxes
().
filter
(
c
=>
c
.
attributes
(
'
checked
'
));
const
findCheckedCheckboxes
=
()
=>
findAllCheckboxes
().
filter
(
c
=>
c
.
attributes
(
'
checked
'
));
const
findFirsTagColumn
=
()
=>
wrapper
.
find
(
'
.js-tag-column
'
);
const
routeId
=
window
.
btoa
(
JSON
.
stringify
({
name
:
'
foo
'
,
tags_path
:
'
bar
'
}));
const
routeId
=
window
.
btoa
(
JSON
.
stringify
({
name
:
'
foo
'
,
tags_path
:
'
bar
'
}));
beforeEach
(()
=>
{
const
mountComponent
=
options
=>
{
wrapper
=
mount
(
component
,
{
wrapper
=
mount
(
component
,
{
store
,
store
,
stubs
:
{
stubs
:
{
...
@@ -49,7 +50,11 @@ describe('Details Page', () => {
...
@@ -49,7 +50,11 @@ describe('Details Page', () => {
},
},
$toast
,
$toast
,
},
},
...
options
,
});
});
};
beforeEach
(()
=>
{
dispatchSpy
=
jest
.
spyOn
(
store
,
'
dispatch
'
);
dispatchSpy
=
jest
.
spyOn
(
store
,
'
dispatch
'
);
store
.
dispatch
(
'
receiveTagsListSuccess
'
,
tagsListResponse
);
store
.
dispatch
(
'
receiveTagsListSuccess
'
,
tagsListResponse
);
jest
.
spyOn
(
Tracking
,
'
event
'
);
jest
.
spyOn
(
Tracking
,
'
event
'
);
...
@@ -61,6 +66,7 @@ describe('Details Page', () => {
...
@@ -61,6 +66,7 @@ describe('Details Page', () => {
describe
(
'
when isLoading is true
'
,
()
=>
{
describe
(
'
when isLoading is true
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
mountComponent
();
store
.
dispatch
(
'
receiveTagsListSuccess
'
,
{
...
tagsListResponse
,
data
:
[]
});
store
.
dispatch
(
'
receiveTagsListSuccess
'
,
{
...
tagsListResponse
,
data
:
[]
});
store
.
commit
(
SET_MAIN_LOADING
,
true
);
store
.
commit
(
SET_MAIN_LOADING
,
true
);
});
});
...
@@ -81,6 +87,10 @@ describe('Details Page', () => {
...
@@ -81,6 +87,10 @@ describe('Details Page', () => {
});
});
describe
(
'
table
'
,
()
=>
{
describe
(
'
table
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
.
each
([
it
.
each
([
'
rowCheckbox
'
,
'
rowCheckbox
'
,
'
rowName
'
,
'
rowName
'
,
...
@@ -93,6 +103,10 @@ describe('Details Page', () => {
...
@@ -93,6 +103,10 @@ describe('Details Page', () => {
});
});
describe
(
'
header checkbox
'
,
()
=>
{
describe
(
'
header checkbox
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
exists
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
expect
(
findMainCheckbox
().
exists
()).
toBe
(
true
);
expect
(
findMainCheckbox
().
exists
()).
toBe
(
true
);
});
});
...
@@ -116,6 +130,10 @@ describe('Details Page', () => {
...
@@ -116,6 +130,10 @@ describe('Details Page', () => {
});
});
describe
(
'
row checkbox
'
,
()
=>
{
describe
(
'
row checkbox
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
if selected adds item to selectedItems
'
,
()
=>
{
it
(
'
if selected adds item to selectedItems
'
,
()
=>
{
findFirstRowItem
(
'
rowCheckbox
'
).
vm
.
$emit
(
'
change
'
);
findFirstRowItem
(
'
rowCheckbox
'
).
vm
.
$emit
(
'
change
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
@@ -135,6 +153,10 @@ describe('Details Page', () => {
...
@@ -135,6 +153,10 @@ describe('Details Page', () => {
});
});
describe
(
'
header delete button
'
,
()
=>
{
describe
(
'
header delete button
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
exists
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
expect
(
findBulkDeleteButton
().
exists
()).
toBe
(
true
);
expect
(
findBulkDeleteButton
().
exists
()).
toBe
(
true
);
});
});
...
@@ -182,6 +204,10 @@ describe('Details Page', () => {
...
@@ -182,6 +204,10 @@ describe('Details Page', () => {
});
});
describe
(
'
row delete button
'
,
()
=>
{
describe
(
'
row delete button
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
exists
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
expect
(
expect
(
findAllDeleteButtons
()
findAllDeleteButtons
()
...
@@ -213,9 +239,39 @@ describe('Details Page', () => {
...
@@ -213,9 +239,39 @@ describe('Details Page', () => {
});
});
});
});
});
});
describe
(
'
tag cell
'
,
()
=>
{
describe
(
'
on desktop viewport
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
has class w-25
'
,
()
=>
{
expect
(
findFirsTagColumn
().
classes
()).
toContain
(
'
w-25
'
);
});
});
describe
(
'
on mobile viewport
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
({
data
()
{
return
{
isDesktop
:
false
};
},
});
});
it
(
'
does not has class w-25
'
,
()
=>
{
expect
(
findFirsTagColumn
().
classes
()).
not
.
toContain
(
'
w-25
'
);
});
});
});
});
});
describe
(
'
pagination
'
,
()
=>
{
describe
(
'
pagination
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
exists
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
expect
(
findPagination
().
exists
()).
toBe
(
true
);
expect
(
findPagination
().
exists
()).
toBe
(
true
);
});
});
...
@@ -238,6 +294,10 @@ describe('Details Page', () => {
...
@@ -238,6 +294,10 @@ describe('Details Page', () => {
});
});
describe
(
'
modal
'
,
()
=>
{
describe
(
'
modal
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
();
});
it
(
'
exists
'
,
()
=>
{
it
(
'
exists
'
,
()
=>
{
expect
(
findDeleteModal
().
exists
()).
toBe
(
true
);
expect
(
findDeleteModal
().
exists
()).
toBe
(
true
);
});
});
...
...
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