How to use the ngx-speculoos.fakeRoute function in ngx-speculoos

To help you get started, we’ve selected a few ngx-speculoos 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 Ninja-Squad / globe42 / frontend / src / app / person-wedding-events / person-wedding-events.component.spec.ts View on Github external
id: 42,
        date: '2001-02-28',
        type: 'WEDDING',
        location: 'ABROAD'
      },
      {
        id: 43,
        date: '2003-03-29',
        type: 'DIVORCE',
        location: 'FRANCE'
      }
    ];

    person = { id: 1, firstName: 'JB', lastName: 'Nizet' } as PersonModel;

    route = fakeRoute({
      snapshot: fakeSnapshot({data: {events}})
    });

    const weddingEventService: WeddingEventService =
      jasmine.createSpyObj('weddingEventService', ['list', 'create', 'delete']);
    const confirmService: ConfirmService =
      jasmine.createSpyObj('confirmService', ['confirm']);

    TestBed.configureTestingModule({
      declarations: [
        PersonWeddingEventsComponent,
        DisplayWeddingEventTypePipe,
        ValidationDefaultsComponent,
        DisplayLocationPipe,
        PageTitleDirective,
        FullnamePipe
github Ninja-Squad / globe42 / frontend / src / app / person-memberships / person-memberships.component.spec.ts View on Github external
beforeEach(async(() => {
    jasmine.clock().mockDate(DateTime.fromISO('2018-04-30T15:30:00').toJSDate());

    person = {
      id: 1
    } as PersonModel;

    memberships = [];

    const route = fakeRoute({
      snapshot: fakeSnapshot({
        data: {
          memberships
        }
      })
    });

    TestBed.configureTestingModule({
      declarations: [
        PersonMembershipsComponent,
        DisplayPaymentModePipe,
        ValidationDefaultsComponent,
        PageTitleDirective,
        FullnamePipe
      ],
      providers: [
github Ninja-Squad / globe42 / frontend / src / app / profile / profile.component.spec.ts View on Github external
beforeEach(async(() => {
    profile = {
      login: 'joe',
      admin: true,
      email: 'joe@nowhere.com',
      taskAssignmentEmailNotificationEnabled: true
    } as ProfileModel;

    const route = fakeRoute({
      snapshot: fakeSnapshot({
        data: { profile }
      })
    });

    TestBed.configureTestingModule({
      declarations: [ ProfileComponent ],
      imports: [
        GlobeNgbModule.forRoot(),
        HttpClientTestingModule,
        RouterTestingModule,
        ReactiveFormsModule,
        ValdemortModule
      ],
      providers: [
        { provide: ActivatedRoute, useFactory: () => route }
github Ninja-Squad / globe42 / frontend / src / app / person-resources / person-resources.component.spec.ts View on Github external
monthlyAmount: 400
    },
    {
      id: 15,
      type: { name: 'Electricité'},
      monthlyAmount: 50
    }
  ] as Array;

  const perUnitRevenueInformation: PerUnitRevenueInformationModel = {
    adultLikeCount: 4,
    childCount: 2,
    monoParental: true
  };

  const activatedRoute = fakeRoute({
    snapshot: fakeSnapshot({
      data: {
        incomes,
        charges,
        perUnitRevenueInformation
      }
    })
  });

  let tester: PersonResourcesTester;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [HttpClientModule, RouterTestingModule, GlobeNgbModule.forRoot()],
      declarations: [PersonResourcesComponent, PageTitleDirective, FullnamePipe],
      providers: [
github Ninja-Squad / globe42 / frontend / src / app / person-death / person-death.component.spec.ts View on Github external
beforeEach(async(() => {
    route = fakeRoute({});

    TestBed.configureTestingModule({
      declarations: [ PersonDeathComponent, FullnamePipe ],
      imports: [
        HttpClientTestingModule,
        GlobeNgbModule.forRoot(),
        ValdemortModule,
        RouterTestingModule,
        ReactiveFormsModule
      ],
      providers: [
        { provide: ActivatedRoute, useValue: route },
        { provide: LOCALE_ID, useValue: 'fr-FR' },
      ]
    });
github Ninja-Squad / globe42 / frontend / src / app / person-network-members / person-network-members.component.spec.ts View on Github external
beforeEach(async(() => {
    const member1: NetworkMemberModel = {
      id: 42,
      type: 'DOCTOR',
      text: 'Dr. No'
    };

    const member2: NetworkMemberModel = {
      id: 43,
      type: 'LAWYER',
      text: 'Dr. Yes'
    };

    route = fakeRoute({
      snapshot: fakeSnapshot({
        data: {
          members: [ member1, member2 ]
        }
      })
    });

    TestBed.configureTestingModule({
      declarations: [
        PersonNetworkMembersComponent,
        DisplayNetworkMemberTypePipe,
        ValidationDefaultsComponent,
        PageTitleDirective,
        FullnamePipe
      ],
      providers: [
github Ninja-Squad / globe42 / frontend / src / app / person-family / person-family.component.spec.ts View on Github external
beforeEach(async(() => {
    route = fakeRoute({
      snapshot: fakeSnapshot({
        data: {
        }
      })
    });

    TestBed.configureTestingModule({
      declarations: [PersonFamilyComponent, SituationComponent, PageTitleDirective, FullnamePipe],
      providers: [
        FamilyService,
        ConfirmService,
        { provide: ActivatedRoute, useFactory: () => route }
      ],
      imports: [
        HttpClientTestingModule,
        RouterTestingModule,
github Ninja-Squad / globe42 / frontend / src / app / person-participations / person-participations.component.spec.ts View on Github external
beforeEach(() => {
    participations = [
      {
        id: 42,
        activityType: 'MEAL'
      }
    ];

    person = { id: 1, firstName: 'JB', lastName: 'Nizet' } as PersonModel;

    route = fakeRoute({
      snapshot: fakeSnapshot({data: {participations}})
    });
    currentPersonService = { snapshot: person } as CurrentPersonService;
  });

ngx-speculoos

Helps writing Angular unit tests

MIT
Latest version published 12 days ago

Package Health Score

72 / 100
Full package analysis