mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Test that currentPage is reset when switching tab.
This commit is contained in:
parent
25b0aeb3bf
commit
c5b591ca5d
@ -39,7 +39,7 @@ const mocks = {
|
||||
const defaultData = () => {
|
||||
return {
|
||||
adminListContributions: {
|
||||
contributionCount: 2,
|
||||
contributionCount: 30,
|
||||
contributionList: [
|
||||
{
|
||||
id: 1,
|
||||
@ -152,6 +152,35 @@ describe('CreationConfirm', () => {
|
||||
})
|
||||
|
||||
describe('actions in overlay', () => {
|
||||
describe('change pagination', () => {
|
||||
it('has pagination buttons', () => {
|
||||
expect(wrapper.findComponent({ name: 'BPagination' }).exists()).toBe(true)
|
||||
})
|
||||
|
||||
describe('next page', () => {
|
||||
beforeAll(async () => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper.vm.currentPage = 2
|
||||
})
|
||||
|
||||
it('has currentPage set to 2', () => {
|
||||
expect(wrapper.vm.currentPage).toBe(2)
|
||||
})
|
||||
|
||||
it('calls the API again', () => {
|
||||
expect(adminListContributionsMock).toBeCalledWith({
|
||||
currentPage: 2,
|
||||
order: 'DESC',
|
||||
pageSize: 25,
|
||||
statusFilter: ['IN_PROGRESS', 'PENDING'],
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('delete creation', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.findAll('tr').at(1).findAll('button').at(0).trigger('click')
|
||||
@ -367,6 +396,10 @@ describe('CreationConfirm', () => {
|
||||
await wrapper.find('a[data-test="denied"]').trigger('click')
|
||||
})
|
||||
|
||||
it('refresh the currentPage to 1', () => {
|
||||
expect(wrapper.vm.currentPage).toBe(1)
|
||||
})
|
||||
|
||||
it('refetches contributions with proper filter', () => {
|
||||
expect(adminListContributionsMock).toBeCalledWith({
|
||||
currentPage: 1,
|
||||
@ -383,6 +416,10 @@ describe('CreationConfirm', () => {
|
||||
await wrapper.find('a[data-test="deleted"]').trigger('click')
|
||||
})
|
||||
|
||||
it('refresh the currentPage to 1', () => {
|
||||
expect(wrapper.vm.currentPage).toBe(1)
|
||||
})
|
||||
|
||||
it('refetches contributions with proper filter', () => {
|
||||
expect(adminListContributionsMock).toBeCalledWith({
|
||||
currentPage: 1,
|
||||
@ -399,6 +436,10 @@ describe('CreationConfirm', () => {
|
||||
await wrapper.find('a[data-test="all"]').trigger('click')
|
||||
})
|
||||
|
||||
it('refresh the currentPage to 1', () => {
|
||||
expect(wrapper.vm.currentPage).toBe(1)
|
||||
})
|
||||
|
||||
it('refetches contributions with proper filter', () => {
|
||||
expect(adminListContributionsMock).toBeCalledWith({
|
||||
currentPage: 1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user