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
f9db61fa
Commit
f9db61fa
authored
Dec 13, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more tests for pagination
parent
7d2ca647
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
app/assets/javascripts/vue_pipelines_index/stage.js.es6
app/assets/javascripts/vue_pipelines_index/stage.js.es6
+0
-1
spec/javascripts/vue_pagination/pagination_spec.js.es6
spec/javascripts/vue_pagination/pagination_spec.js.es6
+29
-1
No files found.
app/assets/javascripts/vue_pipelines_index/stage.js.es6
View file @
f9db61fa
...
...
@@ -12,7 +12,6 @@
return `has-tooltip ci-status-icon-${this.stage.status.label}`;
},
svg() {
// debugger
return this.svgs[this.match(this.stage.status.icon)];
},
},
...
...
spec/javascripts/vue_pagination/pagination_spec.js.es6
View file @
f9db61fa
...
...
@@ -14,7 +14,7 @@ describe('Pagination component', () => {
changeChanges.two = two;
};
it('should render', () => {
it('should render
and start at page 1
', () => {
fixture.set('<div class="test-pagination-container"></div>');
component = new window.gl.VueGlPagination({
...
...
@@ -36,4 +36,32 @@ describe('Pagination component', () => {
expect(changeChanges.one).toEqual(1);
expect(changeChanges.two).toEqual('all');
});
it('should change page to 2 and previous should go cak to 1', () => {
fixture.set('<div class="test-pagination-container"></div>');
component = new window.gl.VueGlPagination({
el: document.querySelector('.test-pagination-container'),
propsData: {
pageInfo: {
totalPages: 10,
nextPage: 2,
previousPage: '',
},
change,
},
});
expect(component.$el.classList).toContain('gl-pagination');
component.changepage({ target: { innerText: '2' } });
expect(changeChanges.one).toEqual(2);
expect(changeChanges.two).toEqual('all');
component.changepage({ target: { innerText: 'Prev' } });
expect(changeChanges.one).toEqual(1);
expect(changeChanges.two).toEqual('all');
});
});
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