Commit e28e1f42 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Fix pagination specs

parent 7e3405d7
...@@ -93,10 +93,9 @@ ...@@ -93,10 +93,9 @@
}, },
}, },
methods: { methods: {
changePage(e) { changePage(text, isDisabled) {
if (e.target.parentElement.classList.contains('disabled')) return; if (isDisabled) return;
const text = e.target.innerText;
const { totalPages, nextPage, previousPage } = this.pageInfo; const { totalPages, nextPage, previousPage } = this.pageInfo;
switch (text) { switch (text) {
...@@ -142,7 +141,7 @@ ...@@ -142,7 +141,7 @@
disabled: item.disabled disabled: item.disabled
}" }"
> >
<a @click.prevent="changePage($event)"> <a @click.prevent="changePage(item.title, item.disabled)">
{{ item.title }} {{ item.title }}
</a> </a>
</li> </li>
......
...@@ -72,7 +72,6 @@ describe('Pagination component', () => { ...@@ -72,7 +72,6 @@ describe('Pagination component', () => {
}); });
component.$el.querySelector('.js-previous-button a').click(); component.$el.querySelector('.js-previous-button a').click();
expect(spy).toHaveBeenCalledWith(1); expect(spy).toHaveBeenCalledWith(1);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment