Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: TT-310 Add missing tests
  • Loading branch information
jcalarcon98 committed Aug 17, 2021
commit ef52527783b5f698b72cc2783cff35038bb9b7ee
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<div class="table-responsive">
<table *ngIf="users" class="table table-sm table-bordered table-striped mb-0" datatable [dtTrigger]="dtTrigger"
<table
*ngIf="users"
class="table table-sm table-bordered table-striped mb-0"
datatable
[dtTrigger]="dtTrigger"
[dtOptions]="dtOptions">
<thead class="thead-blue">
<tr class="d-flex flex-wrap">
Expand All @@ -14,11 +18,14 @@
<td class="col-4 text-break">{{ user.email }}</td>
<td class="col-5 text-break">{{ user.name }}</td>
<td class="col-3 text-center">
<ui-switch size="small"
<ui-switch
size="small"
(change)="switchGroup('time-tracker-admin', user); updateRole(ROLES.admin, user, $event);"
[checked]="user.groups.includes('time-tracker-admin')"></ui-switch>
admin
<ui-switch size="small" (change)="switchGroup('time-tracker-tester', user)"
<ui-switch
size="small"
(change)="switchGroup('time-tracker-tester', user)"
[checked]="user.groups.includes('time-tracker-tester')"></ui-switch>
test
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { UserActionTypes, UserState, LoadUsers, AddUserToGroup, RemoveUserFromGr
import { ActionsSubject } from '@ngrx/store';
import { DataTablesModule } from 'angular-datatables';
import { GrantUserRole, RevokeUserRole } from '../../store/user.actions';
import { ROLES } from '../../../../../environments/environment';

describe('UsersListComponent', () => {
let component: UsersListComponent;
Expand Down Expand Up @@ -224,6 +225,10 @@ describe('UsersListComponent', () => {
});
});

it('When we call ROLES variable should return available roles', () => {
expect(component.ROLES).toEqual(ROLES);
});

afterEach(() => {
component.dtTrigger.unsubscribe();
component.loadUsersSubscription.unsubscribe();
Expand Down