import {ComponentFixture, TestBed} from '@angular/core/testing';
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {RouterTestingModule} from '@angular/router/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

import {NavbarUiComponent} from './navbar.component';
import {NavigationStore} from '@store/navigation/navigation.store';
import {LanguageStore} from '@store/language/language.store';
import {navigationMock} from '@store/navigation/navigation.store.spec.mock';
import {languageStoreMock} from '@store/language/language.store.spec.mock';
import {UserPreferenceStore} from '@store/user-preference/user-preference.store';
import {userPreferenceStoreMock} from '@store/user-preference/user-preference.store.spec.mock';
import {ApolloTestingModule} from 'apollo-angular/testing';

describe('NavbarUiComponent', () => {


    describe('Test with mock service', () => {
        let component: NavbarUiComponent;
        let fixture: ComponentFixture<NavbarUiComponent>;

        beforeEach(() => {
            TestBed.configureTestingModule({
                schemas: [CUSTOM_ELEMENTS_SCHEMA],
                imports: [
                    RouterTestingModule,
                    HttpClientTestingModule,
                    NgbModule,
                    ApolloTestingModule
                ],
                providers: [
                    {provide: NavigationStore, useValue: navigationMock},
                    {provide: LanguageStore, useValue: languageStoreMock},
                    {provide: UserPreferenceStore, useValue: userPreferenceStoreMock},
                ],
                declarations: [NavbarUiComponent]
            }).compileComponents();
            fixture = TestBed.createComponent(NavbarUiComponent);
            component = fixture.componentInstance;
        });

        it('should create', () => {
            fixture.detectChanges();

            expect(component).toBeTruthy();
        });

    });

});
