|
|
|
@ -12,6 +12,7 @@ import { |
|
|
|
|
userSessionsLoadedAction, |
|
|
|
|
userListAdminReducer, |
|
|
|
|
queryChanged, |
|
|
|
|
filterChanged, |
|
|
|
|
} from './reducers'; |
|
|
|
|
import { LdapState, LdapUser, UserAdminState, UserDTO, UserListAdminState } from 'app/types'; |
|
|
|
|
|
|
|
|
@ -287,4 +288,22 @@ describe('User List Admin reducer', () => { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('When filter changed', () => { |
|
|
|
|
it('should reset page to 0', () => { |
|
|
|
|
const initialState = { |
|
|
|
|
...makeInitialUserListAdminState(), |
|
|
|
|
page: 3, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
reducerTester<UserListAdminState>() |
|
|
|
|
.givenReducer(userListAdminReducer, initialState) |
|
|
|
|
.whenActionIsDispatched(filterChanged({ test: true })) |
|
|
|
|
.thenStateShouldEqual({ |
|
|
|
|
...makeInitialUserListAdminState(), |
|
|
|
|
page: 0, |
|
|
|
|
filters: expect.arrayContaining([{ test: true }]), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|