Fix inconsistent pagination styles

This commit is contained in:
Clement Ho 2019-02-27 10:16:46 +00:00 committed by Kushal Pandya
parent d6696f819b
commit d63483a2da
9 changed files with 19 additions and 13 deletions

View file

@ -149,9 +149,9 @@ export default {
}"
class="page-item"
>
<a class="page-link" @click.prevent="changePage(item.title, item.disabled)">
<button type="button" class="page-link" @click="changePage(item.title, item.disabled)">
{{ item.title }}
</a>
</button>
</li>
</ul>
</div>

View file

@ -44,3 +44,4 @@ $spacers: (
5: ($spacer * 4),
6: ($spacer * 8)
);
$pagination-color: $gl-text-color;

View file

@ -0,0 +1,5 @@
---
title: Fix inconsistent pagination styles
merge_request:
author:
type: fixed

View file

@ -485,7 +485,7 @@ describe 'Pipelines', :js do
it 'should show updated content' do
visit project_pipelines_path(project)
wait_for_requests
page.find('.js-next-button a').click
page.find('.js-next-button .page-link').click
expect(page).to have_selector('.gl-pagination .page', count: 2)
end

View file

@ -87,7 +87,7 @@ describe('Pipelines table in Commits and Merge requests', function() {
};
vm.$nextTick(() => {
vm.$el.querySelector('.js-next-button a').click();
vm.$el.querySelector('.js-next-button .page-link').click();
expect(vm.updateContent).toHaveBeenCalledWith({ page: '2' });
done();

View file

@ -94,7 +94,7 @@ describe('Environment', () => {
it('should make an API request when page is clicked', done => {
spyOn(component, 'updateContent');
setTimeout(() => {
component.$el.querySelector('.gl-pagination li:nth-child(5) a').click();
component.$el.querySelector('.gl-pagination li:nth-child(5) .page-link').click();
expect(component.updateContent).toHaveBeenCalledWith({ scope: 'available', page: '2' });
done();

View file

@ -107,7 +107,7 @@ describe('Environments Folder View', () => {
it('should make an API request when changing page', done => {
spyOn(component, 'updateContent');
setTimeout(() => {
component.$el.querySelector('.gl-pagination .js-last-button a').click();
component.$el.querySelector('.gl-pagination .js-last-button .page-link').click();
expect(component.updateContent).toHaveBeenCalledWith({
scope: component.scope,

View file

@ -446,7 +446,7 @@ describe('Pipelines', () => {
};
vm.$nextTick(() => {
vm.$el.querySelector('.js-next-button a').click();
vm.$el.querySelector('.js-next-button .page-link').click();
expect(vm.updateContent).toHaveBeenCalledWith({ scope: 'all', page: '2' });

View file

@ -53,7 +53,7 @@ describe('Pagination component', () => {
component.$el.querySelector('.js-previous-button').classList.contains('disabled'),
).toEqual(true);
component.$el.querySelector('.js-previous-button a').click();
component.$el.querySelector('.js-previous-button .page-link').click();
expect(spy).not.toHaveBeenCalled();
});
@ -71,7 +71,7 @@ describe('Pagination component', () => {
change: spy,
});
component.$el.querySelector('.js-previous-button a').click();
component.$el.querySelector('.js-previous-button .page-link').click();
expect(spy).toHaveBeenCalledWith(1);
});
@ -91,7 +91,7 @@ describe('Pagination component', () => {
change: spy,
});
const button = component.$el.querySelector('.js-first-button a');
const button = component.$el.querySelector('.js-first-button .page-link');
expect(button.textContent.trim()).toEqual('« First');
@ -115,7 +115,7 @@ describe('Pagination component', () => {
change: spy,
});
const button = component.$el.querySelector('.js-last-button a');
const button = component.$el.querySelector('.js-last-button .page-link');
expect(button.textContent.trim()).toEqual('Last »');
@ -141,7 +141,7 @@ describe('Pagination component', () => {
expect(component.$el.querySelector('.js-next-button').textContent.trim()).toEqual('Next');
component.$el.querySelector('.js-next-button a').click();
component.$el.querySelector('.js-next-button .page-link').click();
expect(spy).not.toHaveBeenCalled();
});
@ -159,7 +159,7 @@ describe('Pagination component', () => {
change: spy,
});
component.$el.querySelector('.js-next-button a').click();
component.$el.querySelector('.js-next-button .page-link').click();
expect(spy).toHaveBeenCalledWith(4);
});