TSK-1349: Unit tests for workbasket-details, -information (#1237)

* TSK-1349: init test file for workbasket details

* TSK-1349: updated workbasket details test

* TSK-1349: extended tests for workbasket-details

* TSK-1349: init workbasket-information test

* TSK-1349: added test cases for workbasket information

* TSK-1349: added undo test

* TSK-1349: moved data to mock-store, extend workbasket information tests

* TSK-1349: Fixed typos, naming variables
This commit is contained in:
Chi Nguyen 2020-08-24 16:57:48 +02:00 committed by GitHub
parent e0a99bc9a9
commit f99c437fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 607 additions and 67 deletions

View File

@ -19,6 +19,7 @@ import { TypeAheadComponent } from '../../../shared/components/type-ahead/type-a
import { TypeaheadModule } from 'ngx-bootstrap';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Direction, Sorting } from '../../../shared/models/sorting';
import { engineConfigurationMock } from '../../../shared/store/mock-data/mock-store';
const isFieldValidFn = jest.fn().mockReturnValue(true);
const formValidatorServiceSpy = jest.fn().mockImplementation(
@ -34,40 +35,6 @@ const notificationServiceSpy = jest.fn().mockImplementation(
})
);
export const engineConfigInitState = {
customisation: {
EN: {
workbaskets: {
'access-items': {
accessId: {
lookupField: true
},
custom3: {
field: '',
visible: false
},
custom9: {
field: 'Some custom field',
visible: true
},
custom10: {
field: '',
visible: false
},
custom11: {
field: '',
visible: false
},
custom12: {
field: '',
visible: false
}
}
}
}
}
};
describe('AccessItemsManagementComponent', () => {
let fixture: ComponentFixture<AccessItemsManagementComponent>;
let debugElement: DebugElement;
@ -120,7 +87,7 @@ describe('AccessItemsManagementComponent', () => {
actions$ = TestBed.inject(Actions);
store.reset({
...store.snapshot(),
engineConfiguration: engineConfigInitState
engineConfiguration: engineConfigurationMock
});
app.accessIdSelected = '1';
fixture.detectChanges();

View File

@ -2,11 +2,6 @@
<taskana-shared-spinner [isRunning]="requestInProgress"></taskana-shared-spinner>
<div id="workbasket-details" *ngIf="workbasket && !requestInProgress">
<ul class="nav nav-tabs" role="tablist">
<li *ngIf="showDetail" class="visible-xs visible-sm hidden">
<a (click)="backClicked()">
<span class="material-icons md-20 blue" title="back">arrow_back</span>
</a>
</li>
<li role="presentation" (click)="selectTab('information')" [ngClass]="{'active':tabSelected === 'information'}">
<a aria-controls="work baskets" role="tab" aria-expanded="true">
Information</a>

View File

@ -0,0 +1,163 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkbasketDetailsComponent } from './workbasket-details.component';
import { Component, DebugElement, Input } from '@angular/core';
import { Actions, NgxsModule, Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { Workbasket } from '../../../shared/models/workbasket';
import { ACTION } from '../../../shared/models/action';
import { WorkbasketState } from '../../../shared/store/workbasket-store/workbasket.state';
import { DomainService } from '../../../shared/services/domain/domain.service';
import { ImportExportService } from '../../services/import-export.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { WorkbasketService } from '../../../shared/services/workbasket/workbasket.service';
import { RouterTestingModule } from '@angular/router/testing';
import { RequestInProgressService } from '../../../shared/services/request-in-progress/request-in-progress.service';
import { SelectedRouteService } from '../../../shared/services/selected-route/selected-route';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatDialogModule } from '@angular/material/dialog';
import { selectedWorkbasketMock } from '../../../shared/store/mock-data/mock-store';
@Component({ selector: 'taskana-shared-spinner', template: '' })
class SpinnerStub {
@Input() isRunning: boolean;
}
@Component({ selector: 'taskana-administration-workbasket-information', template: '<div>i</div>' })
class WorkbasketInformationStub {
@Input() workbasket: Workbasket;
@Input() action: ACTION;
}
@Component({ selector: 'taskana-administration-workbasket-access-items', template: '' })
class WorkbasketAccessItemsStub {
@Input() workbasket: Workbasket;
@Input() action: ACTION;
@Input() active: string;
}
@Component({ selector: 'taskana-administration-workbasket-distribution-targets', template: '' })
class WorkbasketDistributionTargetsStub {
@Input() workbasket: Workbasket;
@Input() action: ACTION;
@Input() active: string;
}
export const workbasketCopyState = {
selectedWorkbasket: selectedWorkbasketMock,
action: ACTION.COPY
};
export const workbasketCreateState = {
selectedWorkbasket: selectedWorkbasketMock,
action: ACTION.CREATE
};
export const workbasketReadState = {
selectedWorkbasket: selectedWorkbasketMock,
action: ACTION.READ
};
describe('WorkbasketDetailsComponent', () => {
let fixture: ComponentFixture<WorkbasketDetailsComponent>;
let debugElement: DebugElement;
let component: WorkbasketDetailsComponent;
let store: Store;
let actions$: Observable<any>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
NgxsModule.forRoot([WorkbasketState]),
HttpClientTestingModule,
RouterTestingModule.withRoutes([]),
MatSnackBarModule,
MatDialogModule
],
declarations: [
WorkbasketDetailsComponent,
SpinnerStub,
WorkbasketAccessItemsStub,
WorkbasketDistributionTargetsStub,
WorkbasketInformationStub
],
providers: [DomainService, ImportExportService, WorkbasketService, RequestInProgressService, SelectedRouteService]
}).compileComponents();
fixture = TestBed.createComponent(WorkbasketDetailsComponent);
debugElement = fixture.debugElement;
component = fixture.debugElement.componentInstance;
store = TestBed.inject(Store);
actions$ = TestBed.inject(Actions);
fixture.detectChanges();
}));
it('should create component', () => {
expect(component).toBeTruthy();
});
it('should display loading spinner while content loads', () => {
component.requestInProgress = true;
fixture.detectChanges();
const spinner = debugElement.nativeElement.querySelector('taskana-shared-spinner');
expect(spinner).toBeTruthy();
expect(spinner.style.display).toContain('');
});
it('should render workbasket-details when workbasket exists and request is not in progress', () => {
component.workbasket = { workbasketId: '1' };
component.requestInProgress = false;
fixture.detectChanges();
const workbasketDetails = debugElement.nativeElement.querySelector('#workbasket-details');
expect(workbasketDetails).toBeTruthy();
});
it('should render information, access items and distribution targets components', () => {
component.workbasket = { workbasketId: '1' };
component.requestInProgress = false;
fixture.detectChanges();
const information = debugElement.nativeElement.querySelector('taskana-administration-workbasket-information');
const accessItems = debugElement.nativeElement.querySelector('taskana-administration-workbasket-access-items');
const distributionTargets = debugElement.nativeElement.querySelector(
'taskana-administration-workbasket-distribution-targets'
);
expect(information).toBeTruthy();
expect(accessItems).toBeTruthy();
expect(distributionTargets).toBeTruthy();
});
it('should render new workbasket when action is CREATE', () => {
store.reset({
...store.snapshot(),
workbasket: workbasketCreateState
});
fixture.detectChanges();
expect(component.tabSelected).toMatch('information');
expect(component.selectedId).toBeUndefined();
});
it('should render copied workbasket when action is COPY', () => {
store.reset({
...store.snapshot(),
workbasket: workbasketCopyState
});
component.ngOnInit();
fixture.detectChanges();
expect(component.workbasketCopy).toEqual(component.workbasket);
});
it('should render workbasket when action is READ', () => {
store.reset({
...store.snapshot(),
workbasket: workbasketReadState
});
fixture.detectChanges();
expect(component.workbasket).not.toBeUndefined();
expect(component.workbasket).not.toBeNull();
expect(component.workbasket).toEqual(selectedWorkbasketMock);
});
it('should select information tab when action is CREATE', () => {
component.action = ACTION.CREATE;
component.selectTab('workbasket');
expect(component.tabSelected).toEqual('information');
});
});

View File

@ -1,17 +1,12 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { Workbasket } from 'app/shared/models/workbasket';
import { ACTION } from 'app/shared/models/action';
import { WorkbasketService } from 'app/shared/services/workbasket/workbasket.service';
import { MasterAndDetailService } from 'app/shared/services/master-and-detail/master-and-detail.service';
import { DomainService } from 'app/shared/services/domain/domain.service';
import { ImportExportService } from 'app/administration/services/import-export.service';
import { Select, Store } from '@ngxs/store';
import { Select } from '@ngxs/store';
import { takeUntil } from 'rxjs/operators';
import { NotificationService } from '../../../shared/services/notifications/notification.service';
import { WorkbasketAndAction, WorkbasketSelectors } from '../../../shared/store/workbasket-store/workbasket.selectors';
import { TaskanaDate } from '../../../shared/util/taskana.date';
import { ICONTYPES } from '../../../shared/models/icon-types';
@ -24,7 +19,6 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
workbasket: Workbasket;
workbasketCopy: Workbasket;
selectedId: string;
showDetail = false;
requestInProgress = false;
action: ACTION;
tabSelected = 'information';
@ -41,12 +35,10 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
destroy$ = new Subject<void>();
constructor(
private service: WorkbasketService,
private route: ActivatedRoute,
private router: Router,
private domainService: DomainService,
private importExportService: ImportExportService,
private store: Store
private importExportService: ImportExportService
) {}
ngOnInit() {
@ -91,7 +83,6 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
}
backClicked(): void {
this.service.selectWorkBasket();
this.router.navigate(['./'], { relativeTo: this.route.parent });
}
@ -99,7 +90,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
this.tabSelected = this.action === ACTION.CREATE ? 'information' : tab;
}
private getWorkbasketInformation(selectedWorkbasket?: Workbasket) {
getWorkbasketInformation(selectedWorkbasket?: Workbasket) {
let workbasketIdSelected: string;
if (selectedWorkbasket) {
workbasketIdSelected = selectedWorkbasket.workbasketId;
@ -128,7 +119,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
}
}
private checkDomainAndRedirect() {
checkDomainAndRedirect() {
this.domainService
.getSelectedDomain()
.pipe(takeUntil(this.destroy$))

View File

@ -158,7 +158,7 @@
<div *ngIf="inputOverflowMap.get(orgLevel4.name)" class="error">{{lengthError}}</div>
</div>
<ng-container *ngFor="let customField of customFields$ | async; let index = index">
<div *ngIf="customField.visible" class="form-group">
<div *ngIf="customField.visible" class="custom-fields form-group">
<label for='wb-custom-{{index+1}}' class="control-label">{{customField.field}}</label>
<input type="text" class="form-control" id="wb-custom-{{index+1}}"
[placeholder]="customField.field"

View File

@ -0,0 +1,213 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkbasketInformationComponent } from './workbasket-information.component';
import { Component, DebugElement, Input } from '@angular/core';
import { Actions, NgxsModule, ofActionDispatched, Store } from '@ngxs/store';
import { Observable, of } from 'rxjs';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ICONTYPES } from '../../../shared/models/icon-types';
import { MapValuesPipe } from '../../../shared/pipes/map-values.pipe';
import { RemoveNoneTypePipe } from '../../../shared/pipes/remove-empty-type.pipe';
import { WorkbasketService } from '../../../shared/services/workbasket/workbasket.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { SavingWorkbasketService } from '../../services/saving-workbaskets.service';
import { RequestInProgressService } from '../../../shared/services/request-in-progress/request-in-progress.service';
import { FormsValidatorService } from '../../../shared/services/forms-validator/forms-validator.service';
import { NotificationService } from '../../../shared/services/notifications/notification.service';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatDialogModule } from '@angular/material/dialog';
import { EngineConfigurationState } from '../../../shared/store/engine-configuration-store/engine-configuration.state';
import { WorkbasketState } from '../../../shared/store/workbasket-store/workbasket.state';
import { DomainService } from '../../../shared/services/domain/domain.service';
import { RouterTestingModule } from '@angular/router/testing';
import { SelectedRouteService } from '../../../shared/services/selected-route/selected-route';
import { ClassificationCategoriesService } from '../../../shared/services/classification-categories/classification-categories.service';
import { ACTION } from '../../../shared/models/action';
import { TypeaheadModule } from 'ngx-bootstrap';
import { TypeAheadComponent } from '../../../shared/components/type-ahead/type-ahead.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MarkWorkbasketForDeletion, UpdateWorkbasket } from '../../../shared/store/workbasket-store/workbasket.actions';
import {
selectedWorkbasketMock,
engineConfigurationMock,
workbasketReadStateMock
} from '../../../shared/store/mock-data/mock-store';
@Component({ selector: 'taskana-shared-spinner', template: '' })
class SpinnerStub {
@Input() isRunning: boolean;
}
@Component({ selector: 'taskana-shared-field-error-display', template: '' })
class FieldErrorDisplayStub {
@Input() displayError: boolean;
@Input() errorMessage: string;
@Input() validationTrigger: boolean;
}
@Component({ selector: 'taskana-administration-icon-type', template: '' })
class IconTypeStub {
@Input() type: ICONTYPES = ICONTYPES.ALL;
@Input() text: string;
}
const triggerWorkbasketSavedFn = jest.fn().mockReturnValue(true);
const workbasketServiceMock = jest.fn().mockImplementation(
(): Partial<WorkbasketService> => ({
triggerWorkBasketSaved: triggerWorkbasketSavedFn,
updateWorkbasket: jest.fn().mockReturnValue(of(true)),
markWorkbasketForDeletion: jest.fn().mockReturnValue(of(true)),
createWorkbasket: jest.fn().mockReturnValue(of({ ...selectedWorkbasketMock }))
})
);
const isFieldValidFn = jest.fn().mockReturnValue(true);
const validateFormInformationFn = jest.fn().mockImplementation((): Promise<any> => Promise.resolve(true));
const formValidatorServiceSpy = jest.fn().mockImplementation(
(): Partial<FormsValidatorService> => ({
isFieldValid: isFieldValidFn,
validateInputOverflow: jest.fn(),
validateFormInformation: validateFormInformationFn,
get inputOverflowObservable(): Observable<Map<string, boolean>> {
return of(new Map<string, boolean>());
}
})
);
const showDialogFn = jest.fn().mockReturnValue(true);
const notificationServiceSpy = jest.fn().mockImplementation(
(): Partial<NotificationService> => ({
showDialog: showDialogFn,
showToast: showDialogFn,
triggerError: showDialogFn
})
);
describe('WorkbasketInformationComponent', () => {
let fixture: ComponentFixture<WorkbasketInformationComponent>;
let debugElement: DebugElement;
let component: WorkbasketInformationComponent;
let store: Store;
let actions$: Observable<any>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
HttpClientTestingModule,
MatSnackBarModule,
MatDialogModule,
NgxsModule.forRoot([EngineConfigurationState, WorkbasketState]),
TypeaheadModule.forRoot(),
ReactiveFormsModule,
RouterTestingModule.withRoutes([]),
BrowserAnimationsModule
],
declarations: [
WorkbasketInformationComponent,
SpinnerStub,
FieldErrorDisplayStub,
IconTypeStub,
TypeAheadComponent,
MapValuesPipe,
RemoveNoneTypePipe
],
providers: [
{ provide: WorkbasketService, useClass: workbasketServiceMock },
{ provide: FormsValidatorService, useClass: formValidatorServiceSpy },
{ provide: NotificationService, useClass: notificationServiceSpy },
SavingWorkbasketService,
RequestInProgressService,
DomainService,
SelectedRouteService,
ClassificationCategoriesService
]
}).compileComponents();
fixture = TestBed.createComponent(WorkbasketInformationComponent);
debugElement = fixture.debugElement;
component = fixture.componentInstance;
store = TestBed.inject(Store);
actions$ = TestBed.inject(Actions);
store.reset({
...store.snapshot(),
engineConfiguration: engineConfigurationMock,
workbasket: workbasketReadStateMock
});
component.workbasket = selectedWorkbasketMock;
fixture.detectChanges();
}));
it('should create component', () => {
expect(component).toBeTruthy();
});
it('should display custom fields correctly', () => {
const customFields = debugElement.nativeElement.getElementsByClassName('custom-fields');
expect(customFields.length).toBe(3); //mock data has custom1->4 but engineConfig disables custom3 -> [1,2,4]
});
it('should create clone of workbasket when workbasket value changes', () => {
component.action = ACTION.READ;
component.ngOnChanges();
expect(component.workbasketClone).toMatchObject(component.workbasket);
});
it('should display create badge message when action is CREATE', () => {
component.action = ACTION.CREATE;
component.ngOnChanges();
expect(component.badgeMessage).toMatch('Creating new workbasket');
});
it('should display copy badge message when action is COPY', () => {
component.action = ACTION.COPY;
component.ngOnChanges();
expect(component.badgeMessage).toContain(`Copying workbasket: ${component.workbasket.key}`);
});
it('should set type variable in selectType', () => {
const type = ICONTYPES.GROUP;
component.selectType(type);
expect(component.workbasket.type).toMatch(type);
});
it('should submit when validatorService is true', () => {
const formsValidatorService = TestBed.inject(FormsValidatorService);
component.onSubmit();
expect(formsValidatorService.formSubmitAttempt).toBe(true);
});
it('should reset workbasket information when onUndo is called', () => {
component.workbasketClone = selectedWorkbasketMock;
const notificationService = TestBed.inject(NotificationService);
const toastSpy = jest.spyOn(notificationService, 'showToast');
component.onUndo();
expect(toastSpy).toHaveBeenCalled();
expect(component.workbasket).toMatchObject(component.workbasketClone);
});
it('should save workbasket when workbasketId there', async(() => {
component.workbasket = { ...selectedWorkbasketMock };
component.workbasket.workbasketId = '1';
component.action = ACTION.COPY;
let actionDispatched = false;
actions$.pipe(ofActionDispatched(UpdateWorkbasket)).subscribe(() => (actionDispatched = true));
component.onSave();
expect(actionDispatched).toBe(true);
expect(component.workbasketClone).toMatchObject(component.workbasket);
}));
it('should dispatch MarkWorkbasketforDeletion action when onRemoveConfirmed is called', async(() => {
let actionDispatched = false;
actions$.pipe(ofActionDispatched(MarkWorkbasketForDeletion)).subscribe(() => (actionDispatched = true));
component.onRemoveConfirmed();
expect(actionDispatched).toBe(true);
}));
it('should create new workbasket when workbasketId is undefined', () => {
component.workbasket.workbasketId = undefined;
const postNewWorkbasketSpy = jest.spyOn(component, 'postNewWorkbasket');
component.onSave();
expect(postNewWorkbasketSpy).toHaveBeenCalled();
});
});

View File

@ -1,14 +1,11 @@
import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { NgForm } from '@angular/forms';
import { Select, Store } from '@ngxs/store';
import { ICONTYPES } from 'app/shared/models/icon-types';
import { ACTION } from 'app/shared/models/action';
import { customFieldCount, Workbasket } from 'app/shared/models/workbasket';
import { TaskanaDate } from 'app/shared/util/taskana.date';
import { SavingInformation, SavingWorkbasketService } from 'app/administration/services/saving-workbaskets.service';
import { WorkbasketService } from 'app/shared/services/workbasket/workbasket.service';
import { RequestInProgressService } from 'app/shared/services/request-in-progress/request-in-progress.service';
@ -60,8 +57,6 @@ export class WorkbasketInformationComponent implements OnInit, OnChanges, OnDest
constructor(
private workbasketService: WorkbasketService,
private route: ActivatedRoute,
private router: Router,
private savingWorkbasket: SavingWorkbasketService,
private requestInProgressService: RequestInProgressService,
private formsValidatorService: FormsValidatorService,
@ -76,6 +71,7 @@ export class WorkbasketInformationComponent implements OnInit, OnChanges, OnDest
['CLEARANCE', 'Clearance'],
['TOPIC', 'Topic']
]);
this.customFields$ = this.workbasketsCustomisation$.pipe(
map((customisation) => customisation.information),
getCustomFields(customFieldCount)
@ -93,7 +89,7 @@ export class WorkbasketInformationComponent implements OnInit, OnChanges, OnDest
};
}
ngOnChanges(changes: SimpleChanges) {
ngOnChanges(changes?: SimpleChanges) {
this.workbasketClone = { ...this.workbasket };
if (this.action === ACTION.CREATE) {
this.badgeMessage = 'Creating new workbasket';
@ -140,28 +136,28 @@ export class WorkbasketInformationComponent implements OnInit, OnChanges, OnDest
this.store.dispatch(new RemoveDistributionTarget(this.workbasket._links.removeDistributionTargets.href));
}
private onSave() {
onSave() {
this.beforeRequest();
if (!this.workbasket.workbasketId) {
this.postNewWorkbasket();
return;
}
this.store.dispatch(new UpdateWorkbasket(this.workbasket._links.self.href, this.workbasket)).subscribe((state) => {
this.store.dispatch(new UpdateWorkbasket(this.workbasket._links.self.href, this.workbasket)).subscribe(() => {
this.requestInProgressService.setRequestInProgress(false);
this.workbasketClone = { ...this.workbasket };
});
}
private beforeRequest() {
beforeRequest() {
this.requestInProgressService.setRequestInProgress(true);
}
private afterRequest() {
afterRequest() {
this.requestInProgressService.setRequestInProgress(false);
this.workbasketService.triggerWorkBasketSaved();
}
private postNewWorkbasket() {
postNewWorkbasket() {
this.addDateToWorkbasket();
this.store.dispatch(new SaveNewWorkbasket(this.workbasket)).subscribe(() => {
this.afterRequest();
@ -176,13 +172,13 @@ export class WorkbasketInformationComponent implements OnInit, OnChanges, OnDest
});
}
private addDateToWorkbasket() {
addDateToWorkbasket() {
const date = TaskanaDate.getDate();
this.workbasket.created = date;
this.workbasket.modified = date;
}
private onRemoveConfirmed() {
onRemoveConfirmed() {
this.beforeRequest();
this.store.dispatch(new MarkWorkbasketForDeletion(this.workbasket._links.self.href)).subscribe(() => {
this.afterRequest();

View File

@ -0,0 +1,215 @@
import { Workbasket } from '../../models/workbasket';
import { ICONTYPES } from '../../models/icon-types';
import { ACTION } from '../../models/action';
export const engineConfigurationMock = {
customisation: {
EN: {
workbaskets: {
information: {
owner: {
lookupField: true
},
custom1: {
field: 'Customized field 1 title',
visible: true
},
custom3: {
field: '',
visible: false
}
},
'access-items': {
accessId: {
lookupField: true
},
custom3: {
field: '',
visible: false
},
custom9: {
field: 'Some custom field',
visible: true
},
custom10: {
field: '',
visible: false
},
custom11: {
field: '',
visible: false
},
custom12: {
field: '',
visible: false
}
}
}
}
},
language: 'EN'
};
export const selectedWorkbasketMock: Workbasket = {
workbasketId: 'WBI:000000000000000000000000000000000902',
key: 'sOrt003',
name: 'bAsxet2',
domain: 'DOMAIN_A',
type: ICONTYPES.TOPIC,
description: 'Lorem ipsum dolor sit amet.',
owner: 'Max',
custom1: '',
custom2: '',
custom3: '',
custom4: '',
orgLevel1: '',
orgLevel2: '',
orgLevel3: '',
orgLevel4: '',
markedForDeletion: false,
created: '2020-08-18T09:14:41.353Z',
modified: '2020-08-18T09:14:41.353Z',
_links: {
self: {
href: 'http://localhost:8080/taskana/api/v1/workbaskets/WBI:000000000000000000000000000000000902'
},
distributionTargets: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/WBI:000000000000000000000000000000000902/distribution-targets'
},
accessItems: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/WBI:000000000000000000000000000000000902/workbasketAccessItems'
},
allWorkbaskets: {
href: 'http://localhost:8080/taskana/api/v1/workbaskets'
},
removeDistributionTargets: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/WBI:000000000000000000000000000000000902/distribution-targets'
}
}
};
export const workbasketReadStateMock = {
selectedWorkbasket: selectedWorkbasketMock,
paginatedWorkbasketsSummary: {
_links: {
self: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/?sort-by=name&order=asc&domain=DOMAIN_A&page=3&page-size=8'
},
first: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/?sort-by=name&order=asc&domain=DOMAIN_A&page-size=8&page=1'
},
last: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/?sort-by=name&order=asc&domain=DOMAIN_A&page-size=8&page=3'
},
prev: {
href:
'http://localhost:8080/taskana/api/v1/workbaskets/?sort-by=name&order=asc&domain=DOMAIN_A&page-size=8&page=2'
}
},
workbaskets: [
{
workbasketId: 'WBI:100000000000000000000000000000000008',
key: 'USER-2-1',
name: 'PPK User 1 KSC 2',
domain: 'DOMAIN_A',
type: 'PERSONAL',
description: 'PPK User 1 KSC 2',
owner: '',
custom1: '',
custom2: '',
custom3: '',
custom4: '',
orgLevel1: '',
orgLevel2: '',
orgLevel3: '',
orgLevel4: '',
markedForDeletion: false
},
{
workbasketId: 'WBI:100000000000000000000000000000000007',
key: 'USER-1-2',
name: 'PPK User 2 KSC 1',
domain: 'DOMAIN_A',
type: 'PERSONAL',
description: 'PPK User 2 KSC 1',
owner: 'Peter Maier',
custom1: 'custom1',
custom2: 'custom2',
custom3: 'custom3',
custom4: 'custom4',
orgLevel1: 'versicherung',
orgLevel2: 'abteilung',
orgLevel3: 'projekt',
orgLevel4: 'team',
markedForDeletion: false
},
{
workbasketId: 'WBI:100000000000000000000000000000000009',
key: 'USER-2-2',
name: 'PPK User 2 KSC 2',
domain: 'DOMAIN_A',
type: 'PERSONAL',
description: 'PPK User 2 KSC 2',
owner: '',
custom1: '',
custom2: '',
custom3: '',
custom4: '',
orgLevel1: '',
orgLevel2: '',
orgLevel3: '',
orgLevel4: '',
markedForDeletion: false
},
{
workbasketId: 'WBI:100000000000000000000000000000000010',
key: 'TPK_VIP',
name: 'Themenpostkorb VIP',
domain: 'DOMAIN_A',
type: 'TOPIC',
description: 'Themenpostkorb VIP',
owner: '',
custom1: '',
custom2: '',
custom3: '',
custom4: '',
orgLevel1: '',
orgLevel2: '',
orgLevel3: '',
orgLevel4: '',
markedForDeletion: false
},
{
workbasketId: 'WBI:100000000000000000000000000000000016',
key: 'TPK_VIP_2',
name: 'Themenpostkorb VIP 2',
domain: 'DOMAIN_A',
type: 'TOPIC',
description: 'Themenpostkorb VIP',
owner: '',
custom1: '',
custom2: '',
custom3: '',
custom4: '',
orgLevel1: '',
orgLevel2: '',
orgLevel3: '',
orgLevel4: '',
markedForDeletion: false
}
],
page: {
size: 8,
totalElements: 21,
totalPages: 3,
number: 3
}
},
action: ACTION.READ
};