Skip to content

Commit 045cd27

Browse files
authored
Merge pull request #5099 from anynines/feature/fix_display_of_active_and_bindable_services_in_UI
Fix Display of Active and Bindable Services in the UI
2 parents 52e81f0 + 7029287 commit 045cd27

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-services/cf-service-card/cf-service-card.component.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,34 @@ describe('CfServiceCardComponent', () => {
7575
it('should create', () => {
7676
expect(component).toBeTruthy();
7777
});
78+
79+
it('active field should be true/YES', () => {
80+
const activeStatus = fixture.nativeElement.querySelector('app-table-cell-service-active').textContent;
81+
82+
expect(activeStatus).toContain('Yes');
83+
});
84+
85+
it('active field should be false/NO', () => {
86+
component.serviceEntity.entity.active = 0;
87+
fixture.detectChanges();
88+
89+
const activeStatus = fixture.nativeElement.querySelector('app-table-cell-service-active').textContent;
90+
91+
expect(activeStatus).toContain('No');
92+
});
93+
94+
it('bindable field should be true/YES', () => {
95+
const bindableStatus = fixture.nativeElement.querySelector('app-table-cell-service-bindable').textContent;
96+
97+
expect(bindableStatus).toContain('Yes');
98+
});
99+
100+
it('bindable field should be false/NO', () => {
101+
component.serviceEntity.entity.bindable = 0;
102+
fixture.detectChanges();
103+
104+
const bindableStatus = fixture.nativeElement.querySelector('app-table-cell-service-bindable').textContent;
105+
106+
expect(bindableStatus).toContain('No');
107+
});
78108
});

src/frontend/packages/core/src/shared/components/list/list.types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Component } from '@angular/core';
1+
import { Component, Directive, Input } from '@angular/core';
22
import { Observable } from 'rxjs';
33

44
import { IListDataSource, RowState } from './data-sources-controllers/list-data-source-types';
55

6+
@Directive()
67
export abstract class TableCellCustom<T, C = any> {
78
protected pDataSource: IListDataSource<T>;
89
set dataSource(dataSource: IListDataSource<T>) {
@@ -13,6 +14,7 @@ export abstract class TableCellCustom<T, C = any> {
1314
}
1415

1516
protected pRow: T;
17+
@Input()
1618
get row(): T {
1719
return this.pRow;
1820
}

0 commit comments

Comments
 (0)