How to use the @delon/testing.configureTestSuite function in @delon/testing

To help you get started, we’ve selected a few @delon/testing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ng-alain / delon / packages / abc / reuse-tab / reuse-tab.component.spec.ts View on Github external
describe('', () => {
    configureTestSuite(genModule);

    beforeEach(fakeAsync(() => createComp()));

    describe('[default]', () => {
      it('should be create an instance', fakeAsync(() => {
        page.expectCount(1);
      }));
      it('should be add a tab when route changed', fakeAsync(() => {
        page.to('#b').expectCount(2);
      }));
      it('should be change tab via click', fakeAsync(() => {
        expect(layoutComp.change).not.toHaveBeenCalled();
        page.to('#b').go(0);
        expect(layoutComp.change).toHaveBeenCalled();
      }));
      it('should be two tab in routing parameters', fakeAsync(() => {
github ng-alain / delon / packages / abc / ellipsis / ellipsis.spec.ts View on Github external
describe('', () => {
    configureTestSuite(genModule);

    it('should be not length & line', () => {
      fixture = TestBed.createComponent(TestLengthComponent);
      dl = fixture.debugElement;
      context = fixture.componentInstance;
      context.lines = null;
      context.length = null;
      fixture.detectChanges();
      page = new PageObject();
      fixture.detectChanges();
      page.checkCls('.ellipsis', 1);
    });

    describe('#length', () => {
      beforeEach(() => {
        fixture = TestBed.createComponent(TestLengthComponent);
github ng-alain / delon / packages / abc / sidebar-nav / sidebar-nav.spec.ts View on Github external
describe('', () => {
    configureTestSuite(createModule);

    describe('[default]', () => {
      it('should be navigate url', () => {
        createComp();
        spyOn(context, 'select');
        const data = deepCopy(MOCKMENUS);
        menuSrv.add(data);
        expect(context.select).not.toHaveBeenCalled();
        expect(router.navigateByUrl).not.toHaveBeenCalled();
        const itemEl = page.getEl('.sidebar-nav__depth1 a');
        itemEl!.click();
        fixture.detectChanges();
        expect(context.select).toHaveBeenCalled();
        expect(router.navigateByUrl).toHaveBeenCalled();
      });
github ng-alain / delon / packages / abc / grid / grid.spec.ts View on Github external
describe('', () => {
    configureTestSuite(moduleAction);
    it('General Configuration', inject([SGConfig], (cog: SGConfig) => {
      cog.gutter = 24;
      ({ fixture, dl, context } = createTestContext(TestComponent));
      expect(context.sgComp.col).toBe(2);
      expect(context.sgComp.gutter).toBe(24);
    }));

    describe('[property]', () => {
      beforeEach(() => {
        ({ fixture, dl, context } = createTestContext(TestComponent));
        fixture.detectChanges();
        page = new PageObject();
      });
      describe('#wrap', () => {
        it('#gutter', () => {
          const gutter = 24;
github ng-alain / delon / packages / abc / edit / edit.spec.ts View on Github external
describe('', () => {
    configureTestSuite(moduleAction);

    it('General Configuration', inject([SEConfig], (cog: SEConfig) => {
      cog.size = 'compact';
      ({ fixture, dl, context } = createTestContext(TestComponent));
      expect(context.seComp.size).toBe('compact');
      expect(context.seComp.nzLayout).toBe('horizontal');
      expect(context.seComp.gutter).toBe(32);
    }));

    describe('', () => {
      beforeEach(createComp);
      describe('[property]', () => {
        describe('#wrap', () => {
          it('#title', () => {
            context.parent_title = `parent_title`;
            fixture.detectChanges();
github ng-alain / delon / packages / abc / view / view.spec.ts View on Github external
describe('', () => {
    configureTestSuite(moduleAction);

    it('General Configuration', inject([SVConfig], (cog: SVConfig) => {
      cog.gutter = 24;
      ({ fixture, dl, context } = createTestContext(TestComponent));
      expect(context.svComp.col).toBe(3);
      expect(context.svComp.gutter).toBe(24);
    }));

    describe('[property]', () => {
      beforeEach(() => {
        ({ fixture, dl, context } = createTestContext(TestComponent));
        fixture.detectChanges();
        page = new PageObject();
      });
      describe('#wrap', () => {
        it('#title', () => {
github ng-alain / delon / packages / form / spec / base.spec.ts View on Github external
export function configureSFTestSuite() {
  configureTestSuite(() => {
    TestBed.configureTestingModule({
      imports: [NoopAnimationsModule, AlainThemeModule.forRoot(), DelonFormModule.forRoot(), HttpClientTestingModule],
      declarations: [TestFormComponent],
    });
  });
}