-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(search): Search setting upgrade (#375)
* style(geo.search.search-selector) useless line * feat(geo.search.search-setting) enable/disable search source with checkbox * fix(context): fix minors issues context module * test(geo.search.search-settings) fix test * style(geo.search.search-settings) useless code * style(geo.search.search-selector) useless line * feat(geo.search.search-setting) enable/disable search source with checkbox * test(geo.search.search-settings) fix test * style(geo.search.search-settings) useless code * fix (geo.search.source.ilayer) get title when language service not loaded * style (geo.search.search-settings) de-hardcode xposition menu
- Loading branch information
1 parent
1466996
commit 67074c6
Showing
9 changed files
with
170 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
packages/geo/src/lib/search/search-settings/search-settings.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { IgoLanguageModule } from '@igo2/core'; | ||
import { SearchSettingsComponent } from './search-settings.component'; | ||
import { CommonModule } from '@angular/common'; | ||
import { | ||
MatTooltipModule, | ||
MatIconModule, | ||
MatButtonModule, | ||
MatMenuModule, | ||
MatRadioModule, | ||
MatCheckboxModule | ||
} from '@angular/material'; | ||
|
||
import { SearchSourceService } from '../shared/search-source.service'; | ||
import { provideDefaultIChercheSearchResultFormatter } from '../shared/sources/icherche.providers'; | ||
import { provideDefaultCoordinatesSearchResultFormatter } from '../shared/sources/coordinates.providers'; | ||
import { SearchSource } from '../shared/sources/source'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import {TranslateHttpLoader} from '@ngx-translate/http-loader'; | ||
|
||
// AoT requires an exported function for factories | ||
export function HttpLoaderFactory(httpClient: HttpClient) { | ||
return new TranslateHttpLoader(httpClient); | ||
} | ||
|
||
describe('SearchSettingsComponent', () => { | ||
let component: SearchSettingsComponent; | ||
let fixture: ComponentFixture<SearchSettingsComponent>; | ||
|
||
beforeEach(async(() => { | ||
|
||
const spy = jasmine.createSpyObj('SearchSourceService', ['getSources']); | ||
|
||
TestBed.configureTestingModule({ | ||
imports: [ | ||
HttpClientModule, | ||
TranslateModule.forRoot({ | ||
loader: { | ||
provide: TranslateLoader, | ||
useFactory: HttpLoaderFactory, | ||
deps: [HttpClient] | ||
} | ||
}), | ||
IgoLanguageModule, | ||
CommonModule, | ||
MatTooltipModule, | ||
MatIconModule, | ||
MatButtonModule, | ||
MatMenuModule, | ||
MatRadioModule, | ||
MatCheckboxModule], | ||
declarations: [ SearchSettingsComponent ], | ||
providers: [ | ||
{ provide: SearchSourceService, useValue: spy }, | ||
provideDefaultIChercheSearchResultFormatter(), | ||
provideDefaultCoordinatesSearchResultFormatter() | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SearchSettingsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters