Skip to content

Commit

Permalink
sort apps per domain, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
pgiertych committed Mar 26, 2024
1 parent 26d47e6 commit bc08ca1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/app/appmarket/domains/domain/domain.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {DcnDeploymentType} from '../../../model/dcndeploymenttype';
import {CustomerNetwork} from '../../../model/customernetwork';
import {MinLengthDirective} from '../../../directive/min-length.directive';
import {MaxLengthDirective} from '../../../directive/max-length.directive';
import { KeyValue } from '../../../model/key-value';
import { DomainAnnotation } from '../../../model/domain-annotation';
import {DomainAnnotation} from '../../../model/domain-annotation';


@Component({
Expand Down Expand Up @@ -71,6 +70,8 @@ export class DomainComponent extends BaseComponent implements OnInit {
this.domainService.getOne(this.domainId).subscribe(
(domain: Domain) => {
this.domain = domain;
this.domain.applicationStatePerDomain
.sort((a, b) => a.applicationBaseName.localeCompare(b.applicationBaseName))
},
err => {
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';

import {UserPrivilegesComponent} from './userprivileges.component';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
Expand All @@ -7,8 +7,8 @@ import {AuthService} from '../../../auth/auth.service';
import {UserDataService} from '../../../service/userdata.service';
import {TranslateFakeLoader, TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {RouterTestingModule} from '@angular/router/testing';
import createSpyObj = jasmine.createSpyObj;
import {of} from 'rxjs';
import createSpyObj = jasmine.createSpyObj;

describe('UserPrivilegesComponent', () => {
let component: UserPrivilegesComponent;
Expand All @@ -18,9 +18,10 @@ describe('UserPrivilegesComponent', () => {
const authServiceSpy = createSpyObj('AuthService', ['hasRole']);
authServiceSpy.hasRole.and.returnValue(true)

const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAll'])
const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAll', 'getMyDomains'])
domainServiceSpy.getGlobalDomainId.and.returnValue(1)
domainServiceSpy.getAll.and.returnValue(of([]))
domainServiceSpy.getMyDomains.and.returnValue(of([]))

TestBed.configureTestingModule({
declarations: [UserPrivilegesComponent],
Expand Down

0 comments on commit bc08ca1

Please sign in to comment.