How to use the @nationalbankbelgium/stark-core/testing.MockStarkRoutingService function in @nationalbankbelgium/stark-core

To help you get started, we’ve selected a few @nationalbankbelgium/stark-core 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 NationalBankBelgium / stark / packages / stark-ui / src / modules / session-ui / components / session-card / session-card.component.spec.ts View on Github external
beforeEach(async(() => {
		return TestBed.configureTestingModule({
			imports: [CommonModule, TranslateModule.forRoot(), MatCardModule],
			declarations: [TestComponent, StarkAppLogoComponent, StarkSessionCardComponent],
			providers: [
				{ provide: STARK_LOGGING_SERVICE, useValue: new MockStarkLoggingService() },
				{ provide: STARK_ROUTING_SERVICE, useValue: new MockStarkRoutingService() } // needed by AppLogo component
			]
		}).compileComponents();
	}));
github NationalBankBelgium / stark / packages / stark-ui / src / modules / app-menu / components / app-menu-item.component.spec.ts View on Github external
public level?: number;
		public menuGroup: StarkMenuGroup = {
			id: "id-item",
			label: "Label",
			isVisible: true,
			isEnabled: true,
			targetState: "test"
		};
	}

	// IMPORTANT: The official way to test components using ChangeDetectionStrategy.OnPush is to wrap it with a test host component
	// see https://github.com/angular/angular/issues/12313#issuecomment-444623173
	let hostComponent: TestHostComponent;
	let component: StarkAppMenuItemComponent;
	let hostFixture: ComponentFixture;
	const mockRoutingService: MockStarkRoutingService = new MockStarkRoutingService();

	/**
	 * async beforeEach
	 */
	beforeEach(async(() => {
		return (
			TestBed.configureTestingModule({
				declarations: [StarkAppMenuItemComponent, TestHostComponent],
				imports: [MatExpansionModule, MatListModule, NoopAnimationsModule, UIRouterModule],
				providers: [
					{ provide: STARK_LOGGING_SERVICE, useValue: new MockStarkLoggingService() },
					{ provide: STARK_ROUTING_SERVICE, useValue: mockRoutingService }
				],
				schemas: [NO_ERRORS_SCHEMA] // tells the Angular compiler to ignore unrecognized elements and attributes (svgIcon)
			})
				/**
github NationalBankBelgium / stark / packages / stark-ui / src / modules / session-ui / pages / session-expired / session-expired-page.component.spec.ts View on Github external
beforeEach(async(() => {
		return TestBed.configureTestingModule({
			declarations: [StarkAppLogoComponent, StarkSessionCardComponent, StarkSessionExpiredPageComponent],
			imports: [CommonModule, MatButtonModule, MatCardModule, TranslateModule.forRoot()],
			providers: [
				{ provide: STARK_ROUTING_SERVICE, useValue: new MockStarkRoutingService() }, // needed by AppLogo component
				{ provide: STARK_LOGGING_SERVICE, useValue: mockLogger },
				{ provide: STARK_APP_CONFIG, useValue: mockStarkAppConfig }
			]
		}).compileComponents();
	}));
github NationalBankBelgium / stark / packages / stark-ui / src / modules / session-ui / pages / preloading / preloading-page.component.spec.ts View on Github external
describe("PreloadingPageComponent", () => {
	let component: StarkPreloadingPageComponent;
	let fixture: ComponentFixture;

	const mockUser: StarkUser = { firstName: "John", lastName: "Doe", username: "jdoe", uuid: "mock-uuid", roles: [] };
	const mockLogger: MockStarkLoggingService = new MockStarkLoggingService();
	const mockUserService: MockStarkUserService = new MockStarkUserService();
	const mockSessionService: MockStarkSessionService = new MockStarkSessionService();
	const mockRoutingService: MockStarkRoutingService = new MockStarkRoutingService();

	beforeEach(async(() => {
		return TestBed.configureTestingModule({
			declarations: [StarkAppLogoComponent, StarkSessionCardComponent, StarkPreloadingPageComponent],
			imports: [CommonModule, MatButtonModule, MatCardModule, TranslateModule.forRoot()],
			providers: [
				{ provide: STARK_LOGGING_SERVICE, useValue: mockLogger },
				{ provide: STARK_ROUTING_SERVICE, useValue: mockRoutingService },
				{ provide: STARK_USER_SERVICE, useValue: mockUserService },
				{ provide: STARK_SESSION_SERVICE, useValue: mockSessionService }
			]
		}).compileComponents();
	}));

	beforeEach(() => {
		fixture = TestBed.createComponent(StarkPreloadingPageComponent);