mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
* refactor(app): create access-control-form react component [EE-2332] fix [EE-2332] * chore(tests): setup msw for async tests and stories chore(sb): add msw support for storybook * refactor(access-control): move loading into component * fix(app): fix users and teams selector stories * chore(access-control): write test for validation
22 lines
504 B
TypeScript
22 lines
504 B
TypeScript
import _ from 'lodash';
|
|
|
|
export function createMockUsers(count: number) {
|
|
return _.range(1, count + 1).map((value) => ({
|
|
Id: value,
|
|
Username: `user${value}`,
|
|
Role: _.random(1, 3),
|
|
UserTheme: '',
|
|
RoleName: '',
|
|
AuthenticationMethod: '',
|
|
Checked: false,
|
|
EndpointAuthorizations: {},
|
|
PortainerAuthorizations: {},
|
|
}));
|
|
}
|
|
|
|
export function createMockTeams(count: number) {
|
|
return _.range(1, count + 1).map((value) => ({
|
|
Id: value,
|
|
Name: `team${value}`,
|
|
}));
|
|
}
|