@angular/core#CUSTOM_ELEMENTS_SCHEMA TypeScript Examples

The following examples show how to use @angular/core#CUSTOM_ELEMENTS_SCHEMA. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app.component.spec.ts    From one-platform with MIT License 6 votes vote down vote up
describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [
        RouterTestingModule
      ],
      declarations: [
        AppComponent
      ],
      schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
    }).compileComponents();
  });

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app).toBeTruthy();
  });

  it(`should have as title 'One Platform | Lighthouse'`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect( app.title ).toEqual('One Platform | Lighthouse');
  });

});
Example #2
Source File: app.component.spec.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
describe('AppComponent', () => {

  let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;

  beforeEach(async(() => {
    statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']);
    splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']);
    platformReadySpy = Promise.resolve();
    platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy });

    TestBed.configureTestingModule({
      declarations: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
      providers: [
        { provide: StatusBar, useValue: statusBarSpy },
        { provide: SplashScreen, useValue: splashScreenSpy },
        { provide: Platform, useValue: platformSpy },
      ],
    }).compileComponents();
  }));

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app).toBeTruthy();
  });

  it('should initialize the app', async () => {
    TestBed.createComponent(AppComponent);
    expect(platformSpy.ready).toHaveBeenCalled();
    await platformReadySpy;
    expect(statusBarSpy.styleDefault).toHaveBeenCalled();
    expect(splashScreenSpy.hide).toHaveBeenCalled();
  });

  // TODO: add more tests!

});
Example #3
Source File: user-list.component.spec.ts    From master-frontend-lemoncode with MIT License 6 votes vote down vote up
describe('Tests del comportamiento en el DOM', () => {

  jest.mock('src/app/services/members.service');
  const mockService = mocked(MembersService, true);
  mockService['getAll'] = jest.fn(() => of(fakeMembers));

  let component: UserListComponent;
  let fixture: ComponentFixture<UserListComponent>;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [
        UserListComponent,
        SearchByLoginPipe
      ],
      imports: [
        FormsModule,
        HttpClientTestingModule
      ],
      providers: [
        // {provide: MembersService, useClass: MockMembersService},
        {provide: MembersService, useValue: mockService},
      ],
      schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
    }).compileComponents();

    fixture = TestBed.createComponent(UserListComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('Debe aparecer un listado', () => {
    const login1 = fixture.nativeElement.querySelector('table tbody tr:first-child td:nth-child(3) span') as HTMLTableRowElement;
    expect(login1.textContent).toContain('antonio08');
  });

});
Example #4
Source File: app.component.spec.ts    From mylog14 with GNU General Public License v3.0 6 votes vote down vote up
describe('AppComponent', () => {

  let platformIsSpy, platformSpy;

  beforeEach(async(() => {
    platformIsSpy = Promise.resolve();
    platformSpy = jasmine.createSpyObj('Platform', { is: platformIsSpy });

    TestBed.configureTestingModule({
      declarations: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
      imports: [],
      providers: [
        { provide: Platform, useValue: platformSpy },
      ],
    }).compileComponents();
  }));

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app).toBeTruthy();
  });

  it('should initialize the app', async () => {
    TestBed.createComponent(AppComponent);
    expect(platformSpy.is).toHaveBeenCalled();
  });
});
Example #5
Source File: app.component.spec.ts    From visualization with MIT License 6 votes vote down vote up
describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
      imports: [
        AppTestingModule
      ],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    }).compileComponents();
  });

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app).toBeTruthy();
  });

});
Example #6
Source File: app.module.ts    From SideQuest with MIT License 6 votes vote down vote up
@NgModule({
    declarations: [
        AppComponent,
        ContentComponent,
        HeaderComponent,
        StatusBarComponent,
        LoadingSpinnerComponent,
        SetupComponent,
        LoadingSpinnerSmallComponent,
        PackagesComponent,
        PackageItemComponent,
        ToolsComponent,
        LinkComponent,
        SanitizeHtmlPipe,
        WebviewComponent,
        WebviewDirective,
        FilesComponent,
        CurrentTasksComponent,
        CurrentTaskItemComponent,
    ],
    imports: [
        BrowserModule,
        DragulaModule.forRoot(),
        FormsModule,
        RouterModule.forRoot(AppRoutes, { useHash: true }),
        MzTooltipModule,
        MzModalModule,
        MzButtonModule,
        HttpClientModule,
        MzCheckboxModule,
        ColorPickerModule,
        BrowserAnimationsModule,
        VirtualScrollerModule,
    ],
    providers: [],
    bootstrap: [AppComponent],
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
Example #7
Source File: get-addon-status-cell.component.spec.ts    From WowUp with GNU General Public License v3.0 6 votes vote down vote up
describe("GetAddonStatusColumnComponent", () => {
  let component: GetAddonStatusColumnComponent;
  let fixture: ComponentFixture<GetAddonStatusColumnComponent>;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [GetAddonStatusColumnComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    }).compileComponents();

    fixture = TestBed.createComponent(GetAddonStatusColumnComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it("should create", () => {
    expect(component).toBeTruthy();
  });
});
Example #8
Source File: app.module.ts    From ASW-Form-Builder with MIT License 6 votes vote down vote up
@NgModule({
    declarations: [
        AppComponent,
        HomeComponent,
        PreviewTemplateComponent,
        TextboxDemoComponent,
        AboutUsComponent,
        ContactUsComponent
    ],
    imports: [
        BrowserModule,
        AppRoutingModule,
        FormsModule,
        ReactiveFormsModule,
        BrowserAnimationsModule,
        MatInputModule,
        MatIconModule,
        ComponentsModule,
        AswFormBuilderModule,
        AswPreviewTemplateModule,
        AswTextboxModule
    ],
    providers: [],
    bootstrap: [AppComponent],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
Example #9
Source File: module.ts    From Elastos.Essentials.App with MIT License 6 votes vote down vote up
@NgModule({
  declarations: [
    OptionsComponent,
    DeleteComponent,
    QRCodeComponent,
    PictureComponent,
    AddPage,
    ConfirmPage,
    CustomizePage,
    FriendDetailsPage,
    FriendsPage,
    InvitePage,
  ],
  imports: [
    CommonModule,
    HttpClientModule,
    IonicModule,
    ContactsRoutingModule,
    QRCodeModule,
    ComponentsModule,
    SharedComponentsModule,
    FormsModule,
    IonicStorageModule.forRoot(),
    TranslateModule
  ],
  bootstrap: [],
  entryComponents: [
    OptionsComponent,
    DeleteComponent,
    QRCodeComponent,
    PictureComponent,
  ],
  providers: [
    Clipboard,
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ContactsModule { }