ACS-8610: cleanup demo shell protractor tests (#10148)

This commit is contained in:
Denys Vuika
2024-09-10 08:36:42 -04:00
committed by GitHub
parent a754976ad9
commit f1208d45c3
402 changed files with 180 additions and 45538 deletions

View File

@@ -1,29 +1,6 @@
@import 'styles/flex';
@import 'styles/mat-selectors';
/* stylelint-disable scss/no-global-function-names */
@mixin adf-line-clamp($line-height: 1.25, $lines: 3) {
position: relative;
line-height: $line-height;
padding: 0;
overflow: hidden;
text-overflow: ellipsis;
/* stylelint-disable */
@supports (-webkit-line-clamp: 1) {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: $lines;
height: calc(0.99em * #{$line-height} * #{$lines});
}
@supports not (-webkit-line-clamp: 1) {
white-space: nowrap;
width: 100%;
}
/* stylelint-enable */
}
.adf-app-list-item {
cursor: pointer;
}
@@ -128,7 +105,6 @@ $tile-themes: (
z-index: 9999;
h1 {
color: white;
width: 80%;
font-size: var(--theme-headline-font-size);
margin: 0;
@@ -140,13 +116,16 @@ $tile-themes: (
}
&-subtitle {
color: white;
z-index: 9999;
padding: 16px;
flex: 1 0 auto;
.adf-line-clamp {
@include adf-line-clamp(1.25, 3);
position: relative;
line-height: 1.25;
padding: 0;
overflow: hidden;
text-overflow: ellipsis;
}
}

View File

@@ -276,4 +276,30 @@ describe('AppsListComponent', () => {
expect(title[0].nativeElement.innerText).toBe('No Apps');
});
});
describe('getAppName', () => {
it('should return the default app name when app is the default app', () => {
const appDataMock: AppDefinitionRepresentation = {
defaultAppId: 'tasks',
name: null
};
expect(component.getAppName(appDataMock)).toBe('ADF_TASK_LIST.APPS.TASK_APP_NAME');
});
it('should return the app name when it is provided', () => {
const appDataMock: AppDefinitionRepresentation = {
defaultAppId: 'uiu',
name: 'the-name'
};
expect(component.getAppName(appDataMock)).toBe('the-name');
});
it('should return the defaultAppId when name is not provided and app is not the default app', () => {
const appDataMock: AppDefinitionRepresentation = {
defaultAppId: 'uiu',
name: null
};
expect(component.getAppName(appDataMock)).toBe('uiu');
});
});
});

View File

@@ -117,7 +117,7 @@ export class AppsListComponent implements OnInit, AfterContentInit, OnDestroy {
}
getAppName(app: AppDefinitionRepresentation): string {
return this.isDefaultApp(app) ? DEFAULT_TASKS_APP_NAME : app.name;
return this.isDefaultApp(app) ? DEFAULT_TASKS_APP_NAME : app.name || app.defaultAppId;
}
/**