Merge pull request #11310 from abpframework/auto-merge/rel-5-1/801

Merge branch dev with rel-5.1
pull/11330/head
Mehmet Erim 4 years ago committed by GitHub
commit 17d9c0ec21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -69,7 +69,7 @@
"@abp/ng.theme.shared": "~5.1.1",
"@fortawesome/fontawesome-free": "^5.15.4",
"@ng-bootstrap/ng-bootstrap": "~12.0.0-beta.4",
"@ngneat/spectator": "^8.0.3",
"@ngneat/spectator": "^10.0.0",
"@ngx-validate/core": "^0.1.1",
"@nrwl/angular": "13.4.3",
"@nrwl/cli": "13.4.3",

@ -1,16 +1,9 @@
import {
Component,
ComponentRef,
EmbeddedViewRef,
TemplateRef,
ViewChild,
ViewContainerRef,
} from '@angular/core';
import { Component, ComponentRef, EmbeddedViewRef, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import {
ComponentProjectionStrategy,
ContainerStrategy,
CONTAINER_STRATEGY,
ContainerStrategy,
CONTEXT_STRATEGY,
DOM_STRATEGY,
PROJECTION_STRATEGY,
@ -57,7 +50,7 @@ describe('ComponentProjectionStrategy', () => {
describe('#injectContent', () => {
it('should should insert content into container and return a ComponentRef', () => {
const strategy = new ComponentProjectionStrategy(TestComponent, containerStrategy);
componentRef = strategy.injectContent({ get: spectator.inject });
componentRef = strategy.injectContent({ get: val => spectator.inject(val) });
spectator.detectChanges();
const div = spectator.query('div.foo');
@ -72,7 +65,7 @@ describe('ComponentProjectionStrategy', () => {
containerStrategy,
contextStrategy,
);
componentRef = strategy.injectContent({ get: spectator.inject });
componentRef = strategy.injectContent({ get: val => spectator.inject(val) });
spectator.detectChanges();
const div = spectator.query('div.foo');
@ -114,7 +107,7 @@ describe('RootComponentProjectionStrategy', () => {
describe('#injectContent', () => {
it('should should insert content into body and return a ComponentRef', () => {
const strategy = new RootComponentProjectionStrategy(TestComponent);
componentRef = strategy.injectContent({ get: spectator.inject });
componentRef = strategy.injectContent({ get: val => spectator.inject(val) });
spectator.detectChanges();
const div = document.querySelector('body > ng-component > div.foo');
@ -127,7 +120,7 @@ describe('RootComponentProjectionStrategy', () => {
it('should be able to map context to projected component', () => {
const contextStrategy = CONTEXT_STRATEGY.Component({ bar: 'bar' });
const strategy = new RootComponentProjectionStrategy(TestComponent, contextStrategy);
componentRef = strategy.injectContent({ get: spectator.inject });
componentRef = strategy.injectContent({ get: val => spectator.inject(val) });
spectator.detectChanges();
const div = document.querySelector('body > ng-component > div.foo');

@ -22,9 +22,12 @@ export function interpolate(text: string, params: string[]) {
.replace(/\s+/g, ' ');
}
export function escapeHtmlChars(value: string) {
return (
value &&
value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
);
export function escapeHtmlChars(value: any) {
return value && typeof value === 'string'
? value
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
: value;
}

@ -4,7 +4,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, Injector } from '@angular/core';
import { Validators } from '@angular/forms';
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { NgxValidateCoreModule, validatePassword } from '@ngx-validate/core';
import { validatePassword } from '@ngx-validate/core';
import { OAuthService } from 'angular-oauth2-oidc';
import { of } from 'rxjs';
import { getPasswordValidators } from '../utils';
@ -15,7 +15,7 @@ describe('ValidationUtils', () => {
let spectator: Spectator<DummyComponent>;
const createComponent = createComponentFactory({
component: DummyComponent,
imports: [CoreTestingModule.withConfig(), NgxValidateCoreModule.forRoot()],
imports: [CoreTestingModule.withConfig()],
mocks: [HttpClient, OAuthService],
providers: [
{

Loading…
Cancel
Save