SHARE
TWEET

Untitled

a guest Apr 5th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Component
  2.  
  3. import { Component, OnInit, Input } from '@angular/core'
  4. import { Appointment } from 'app/appointments/models/appointment'
  5.  
  6. @Component({
  7.   selector: 'thor-appointment-success',
  8.   templateUrl: './appointment-success.component.html',
  9.   styleUrls: ['./appointment-success.component.scss']
  10. })
  11. export class AppointmentSuccessComponent implements OnInit {
  12.   @Input() scheduledAppointment: Appointment
  13.  
  14.   constructor() {}
  15.  
  16.   ngOnInit() {}
  17. }
  18.  
  19. // HTML
  20.  
  21.   <div class="scheduled-appointment-container">
  22.     <div class="cita-date"> {{scheduledAppointment.startDate | appointmentDatePipe: 'EEEE, dd de LLLL a HH:MM a' }} {{scheduledAppointment.endDate|
  23.       date: 'HH:mm'}} </div>
  24.   </div>
  25.  
  26. // Test
  27.  
  28. import { AppointmentDatePipe } from './../../pipes/appointment-date-pipe.pipe'
  29. import { async, ComponentFixture, TestBed } from '@angular/core/testing'
  30.  
  31. import { AppointmentSuccessComponent } from './appointment-success.component'
  32.  
  33.  
  34. describe('AppointmentSuccessComponent', () => {
  35.   let component: AppointmentSuccessComponent
  36.   let fixture: ComponentFixture<AppointmentSuccessComponent>
  37.  
  38.   beforeEach(
  39.     async(() => {
  40.       TestBed.configureTestingModule({
  41.         declarations: [AppointmentSuccessComponent, AppointmentDatePipe]
  42.       }).compileComponents()
  43.     })
  44.   )
  45.  
  46.   beforeEach(() => {
  47.     fixture = TestBed.createComponent(AppointmentSuccessComponent)
  48.     component = fixture.componentInstance
  49.     fixture.detectChanges()
  50.   })
  51.  
  52.   it('should create', () => {
  53.     expect(component).toBeTruthy()
  54.   })
  55. })
  56.  
  57.  
  58. // Result
  59. HeadlessChrome 65.0.3325 (Mac OS X 10.13.3) AppointmentSuccessComponent should create FAILED
  60.     [object ErrorEvent] thrown
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top