當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript timepicker.TimepickerModule類代碼示例

本文整理匯總了TypeScript中ngx-bootstrap/timepicker.TimepickerModule的典型用法代碼示例。如果您正苦於以下問題:TypeScript TimepickerModule類的具體用法?TypeScript TimepickerModule怎麽用?TypeScript TimepickerModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TimepickerModule類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

    beforeEach(async(() => {

        TestBed.overrideModule(BrowserDynamicTestingModule, {

            set: {
                entryComponents: [DynamicBootstrapInputComponent]
            }
        });

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                DynamicFormsCoreModule,
                TextMaskModule,
                BsDatepickerModule.forRoot(),
                TimepickerModule.forRoot()
            ],
            declarations: [DynamicBootstrapFormControlContainerComponent, DynamicBootstrapInputComponent]

        }).compileComponents().then(() => {

            fixture = TestBed.createComponent(DynamicBootstrapFormControlContainerComponent);

            component = fixture.componentInstance;
            debugElement = fixture.debugElement;
        });
    }));
開發者ID:udos86,項目名稱:ng2-dynamic-forms,代碼行數:28,代碼來源:dynamic-bootstrap-form-control-container.component.spec.ts

示例2: beforeEach

    beforeEach(async(() => {

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                NoopAnimationsModule,
                TimepickerModule.forRoot(),
                TextMaskModule,
                DynamicFormsCoreModule
            ],
            declarations: [DynamicBootstrapTimePickerComponent]

        }).compileComponents().then(() => {

            fixture = TestBed.createComponent(DynamicBootstrapTimePickerComponent);

            component = fixture.componentInstance;
            debugElement = fixture.debugElement;
        });
    }));
開發者ID:udos86,項目名稱:ng2-dynamic-forms,代碼行數:21,代碼來源:dynamic-bootstrap-timepicker.component.spec.ts

示例3: describe

describe('LogsComponent', () => {
  let component: LogsComponent;
  let fixture: ComponentFixture<LogsComponent>;

  configureTestBed({
    imports: [
      HttpClientTestingModule,
      TabsModule.forRoot(),
      SharedModule,
      BsDatepickerModule.forRoot(),
      TimepickerModule.forRoot(),
      FormsModule
    ],
    declarations: [LogsComponent]
  });

  beforeEach(() => {
    fixture = TestBed.createComponent(LogsComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });

  describe('abstractfilters', () => {
    it('after initializaed', () => {
      const filters = component.abstractfilters();
      expect(filters.priority).toBe('All');
      expect(filters.key).toBe('');
      expect(filters.yearMonthDay).toBe('');
      expect(filters.sTime).toBe(0);
      expect(filters.eTime).toBe(1439);
    });
    it('change date', () => {
      component.selectedDate = new Date(2019, 0, 1);
      component.startTime = new Date(2019, 1, 1, 1, 10);
      component.endTime = new Date(2019, 1, 1, 12, 10);
      const filters = component.abstractfilters();
      expect(filters.yearMonthDay).toBe('2019-01-01');
      expect(filters.sTime).toBe(70);
      expect(filters.eTime).toBe(730);
    });
  });

  describe('filterLogs', () => {
    const contentData = {
      clog: [
        {
          name: 'priority',
          stamp: '2019-02-21 09:39:49.572801',
          message: 'Manager daemon localhost is now available',
          priority: '[ERR]'
        },
        {
          name: 'search',
          stamp: '2019-02-21 09:39:49.572801',
          message: 'Activating manager daemon localhost',
          priority: '[INF]'
        },
        {
          name: 'date',
          stamp: '2019-01-21 09:39:49.572801',
          message: 'Manager daemon localhost is now available',
          priority: '[INF]'
        },
        {
          name: 'time',
          stamp: '2019-02-21 01:39:49.572801',
          message: 'Manager daemon localhost is now available',
          priority: '[INF]'
        }
      ],
      audit_log: []
    };
    const resetFilter = () => {
      component.selectedDate = null;
      component.priority = 'All';
      component.search = '';
      component.startTime.setHours(0, 0);
      component.endTime.setHours(23, 59);
    };
    beforeEach(() => {
      component.contentData = contentData;
    });

    it('show all log', () => {
      component.filterLogs();
      expect(component.clog.length).toBe(4);
    });

    it('filter by search key', () => {
      resetFilter();
      component.search = 'Activating';
      component.filterLogs();
      expect(component.clog.length).toBe(1);
      expect(component.clog[0].name).toBe('search');
    });

//.........這裏部分代碼省略.........
開發者ID:LenzGr,項目名稱:ceph,代碼行數:101,代碼來源:logs.component.spec.ts


注:本文中的ngx-bootstrap/timepicker.TimepickerModule類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。