mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
test: increase ui test coverage
This commit is contained in:
@@ -88,6 +88,7 @@ import {EventRoutePathComponent} from './types/event/event-route-path.component'
|
||||
import {UtilModule} from '../../util/util.module';
|
||||
import {TreeListComponent} from './list/tree-list.component';
|
||||
import {TreeListFragmentComponent} from './list/tree-list-fragment.component';
|
||||
import {SettingsProvider} from '../settings/settings.provider';
|
||||
|
||||
/**
|
||||
* Module for handling data
|
||||
@@ -179,6 +180,7 @@ import {TreeListFragmentComponent} from './list/tree-list-fragment.component';
|
||||
StAppsWebHttpClient,
|
||||
CalendarService,
|
||||
RoutingStackService,
|
||||
SettingsProvider,
|
||||
],
|
||||
exports: [
|
||||
DataDetailComponent,
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2019 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
* Copyright (C) 2022 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {
|
||||
SCAcademicPriceGroup,
|
||||
SCThingThatCanBeOfferedOffer,
|
||||
} from '@openstapps/core';
|
||||
import {SettingsProvider} from '../../settings/settings.provider';
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@@ -29,5 +30,22 @@ export class OffersInListComponent {
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
@Input() offers: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
|
||||
@Input() set offers(
|
||||
it: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>,
|
||||
) {
|
||||
this._offers = it;
|
||||
this.price = it[0].prices?.default;
|
||||
|
||||
this.settingsProvider.getSetting('profile', 'group').then(group => {
|
||||
this.price =
|
||||
it[0].prices?.[(group.value as string).replace(/s$/, '') as never];
|
||||
console.log(group.value);
|
||||
});
|
||||
}
|
||||
|
||||
price?: number;
|
||||
|
||||
_offers: Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
|
||||
|
||||
constructor(readonly settingsProvider: SettingsProvider) {}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
<!--
|
||||
~ Copyright (C) 2022 StApps
|
||||
~ This program is free software: you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU General Public License as published by the Free
|
||||
~ Software Foundation, version 3.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
~ more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License along with
|
||||
~ this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<h2 *ngIf="offers[0].prices">
|
||||
{{ offers[0].prices.default | currency: 'EUR':'symbol':undefined:'de' }}
|
||||
<h2 *ngIf="price">
|
||||
{{ price | currency: 'EUR':'symbol':undefined:'de' }}
|
||||
</h2>
|
||||
<p *ngIf="offers[0].inPlace">
|
||||
<ion-icon name="location"></ion-icon>{{ offers[0].inPlace.name
|
||||
}}<span *ngIf="offers.length > 1">...</span>
|
||||
<p *ngIf="_offers[0].inPlace">
|
||||
<ion-icon name="location"></ion-icon>{{ _offers[0].inPlace.name
|
||||
}}<span *ngIf="_offers.length > 1">...</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user