Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NAE-1939] Problem with Tests #233

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Full Changelog: [https://github.com/netgrif/components/commits/v6.4.0](https://github.com/netgrif/components/commits/v6.4.0)

## [6.4.0](https://github.com/netgrif/components/releases/tag/v6.4.0) (2023-12-13)
## [6.4.0](https://github.com/netgrif/components/releases/tag/v6.4.0) (2024-01-23)

### Fixed
- [NAE-1915] TaskRef behaviour handling for multiple level
Expand All @@ -28,6 +28,7 @@ Full Changelog: [https://github.com/netgrif/components/commits/v6.4.0](https://g
- [NAE-1900] New component design
- [NAE-1928] Refresh tabs on change
- [NAE-1929] Data field type list of strings
- [NAE-1936] Disable create case button using menu items

## [6.3.0](https://github.com/netgrif/components/releases/tag/v6.3.0) (2023-05-26)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-project",
"version": "6.4.0-beta.11",
"version": "6.4.0-beta.12",
"description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion projects/netgrif-components-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components-core",
"version": "6.4.0-beta.11",
"version": "6.4.0-beta.12",
"description": "Netgrif Application engine frontend core Angular library",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export class AuthenticationService implements OnDestroy {

private static readonly IDENTIFICATION_ATTRIBUTE = 'id';

private _authenticated$: BehaviorSubject<boolean>;
protected _authenticated$: BehaviorSubject<boolean>;
protected subSession: Subscription;

constructor(private _auth: AuthenticationMethodService,
private _config: ConfigurationService,
private _sessionService: SessionService,
private _userTransformer: UserTransformer) {
constructor(protected _auth: AuthenticationMethodService,
protected _config: ConfigurationService,
protected _sessionService: SessionService,
protected _userTransformer: UserTransformer) {
this._authenticated$ = new BehaviorSubject<boolean>(false);
this.subSession = this._sessionService.session$.subscribe(token => {
this._authenticated$.next(!!token && token.length !== 0 && this._sessionService.verified);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class TestLangComponent extends AbstractLanguageSelectorComponent {

@Component({
selector: 'ncc-test-wrapper',
template: '<nae-test-lang language="sk"></nae-test-lang>'
template: '<ncc-test-lang></ncc-test-lang>'
})
class TestWrapperComponent {
lang = 'sk';
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {HttpClientTestingModule} from '@angular/common/http/testing';
import {SideMenuService} from '../services/side-menu.service';
import {TranslateLibModule} from '../../translate/translate-lib.module';
import {MaterialModule} from '../../material/material.module';
import {Component, Inject} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, Inject} from '@angular/core';
import {AbstractSideMenuContainerComponent} from './abstract-side-menu-container.component';
import {AbstractImportNetComponent} from '../content-components/import-net/abstract-import-net.component';
import {NAE_SIDE_MENU_CONTROL} from '../side-menu-injection-token';
Expand Down Expand Up @@ -33,7 +33,8 @@ describe('AbstractSideMenuContainerComponent', () => {
declarations: [TestSideMenuComponent],
providers: [
TranslateService
]
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import {SessionService} from "../../../authentication/session/services/session.s

@Injectable()
export class MockAuthenticationService extends AuthenticationService {
constructor(_auth: AuthenticationMethodService,
_config: ConfigurationService,
_sessionService: SessionService,
_userTransformer: UserTransformer) {

constructor(protected _auth: AuthenticationMethodService,
protected _config: ConfigurationService,
protected _sessionService: SessionService,
protected _userTransformer: UserTransformer) {
super(_auth, _config, _sessionService, _userTransformer);
}

login(credentials: Credentials): Observable<User> {
return of(new User('id', 'mail', 'name', 'surname', ['ADMIN'], [{stringId: 'id', name: 'id', importId: 'id'}]));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ConfigurationService} from '../../../../configuration/configuration.serv
import {TestConfigurationService} from '../../../../utility/tests/test-config';
import {CaseViewService} from '../../service/case-view-service';
import {SearchService} from '../../../../search/search-service/search.service';
import {Component, Inject, Optional} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, Inject, Optional} from '@angular/core';
import {AbstractCaseListComponent} from './abstract-case-list.component';
import {LoggerService} from '../../../../logger/services/logger.service';
import {AuthenticationMethodService} from '../../../../authentication/services/authentication-method.service';
Expand Down Expand Up @@ -49,7 +49,8 @@ describe('AbstractCaseListComponent', () => {
},
{provide: AllowedNetsService, useFactory: TestCaseViewAllowedNetsFactory, deps: [AllowedNetsServiceFactory]}
],
declarations: [TestCaseComponent]
declarations: [TestCaseComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}).compileComponents();
}));

Expand Down
4 changes: 2 additions & 2 deletions projects/netgrif-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netgrif/components",
"version": "6.4.0-beta.11",
"version": "6.4.0-beta.12",
"description": "Netgrif Application Engine frontend Angular components",
"homepage": "https://components.netgrif.com",
"license": "SEE LICENSE IN LICENSE",
Expand Down Expand Up @@ -29,7 +29,7 @@
"nae frontend"
],
"peerDependencies": {
"@netgrif/components-core": "6.4.0-beta.11",
"@netgrif/components-core": "6.4.0-beta.12",
"@angular-material-components/datetime-picker": "~7.0.1",
"@angular-material-components/moment-adapter": "~7.0.0",
"@angular/animations": "~13.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {TaskListComponent} from './task-list.component';
import {MatExpansionModule} from '@angular/material/expansion';
import {CommonModule} from '@angular/common';
import {Component, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {of} from 'rxjs';
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('TaskListComponent', () => {
{provide: TaskResourceService, useClass: MyResources},
{provide: AllowedNetsService, useFactory: TestTaskViewAllowedNetsFactory, deps: [AllowedNetsServiceFactory]}
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
})
.compileComponents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@netgrif/components-core";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {HttpClientTestingModule} from "@angular/common/http/testing";
import {Component, NO_ERRORS_SCHEMA} from "@angular/core";
import {Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from "@angular/core";
import {FormControl} from "@angular/forms";
import {MultiUserAssignItemComponent} from "./multi-user-assign-item/multi-user-assign-item.component";
import {BrowserDynamicTestingModule} from "@angular/platform-browser-dynamic/testing";
Expand All @@ -39,7 +39,7 @@ describe('MultiUserAssignListComponent', () => {
ErrorSnackBarComponent,
TestWrapperComponent
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA]
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {UserAssignListComponent} from './user-assign-list.component';
import {UserAssignItemComponent} from './user-assign-item/user-assign-item.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {Component, NO_ERRORS_SCHEMA} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core';
import {FormControl} from '@angular/forms';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {BrowserDynamicTestingModule} from '@angular/platform-browser-dynamic/testing';
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('UserAssignListComponent', () => {
ErrorSnackBarComponent,
TestWrapperComponent
],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA]
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {TabViewComponent} from './tab-view.component';
import {TabCreationDetectorComponent} from '../tab-creation-detector/tab-creation-detector.component';
import {Component, NgModule} from '@angular/core';
import {Component, CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {
AuthenticationMethodService,
Expand Down Expand Up @@ -46,7 +46,8 @@ describe('TabViewComponent', () => {
TabViewComponent,
TabCreationDetectorComponent,
TestWrapperComponent,
]
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
.compileComponents();

Expand Down