@@ -30,19 +30,19 @@ describe("AppComponent", () => {
3030 expect ( app ) . toBeTruthy ( ) ;
3131 } ) ;
3232
33- it ( ` should have as title 'ESS Public Data Repository test'` , ( ) => {
33+ it ( " should set the title from the configured facility" , ( ) => {
3434 const fixture = TestBed . createComponent ( AppComponent ) ;
3535 const app = fixture . componentInstance ;
36- expect ( app . title ) . toEqual ( "ESS Public Data Repository test" ) ;
36+ expect ( app . title ) . toEqual ( "THE_FACILITY Public Data Repository test" ) ;
3737 } ) ;
3838
3939 it ( `should test app config values'` , fakeAsync ( ( ) => {
4040 const fixture = TestBed . createComponent ( AppComponent ) ;
4141 const app = fixture . componentInstance ;
4242 fixture . detectChanges ( ) ;
43- expect ( app . config . scicatBaseUrl ) . toEqual ( "https://scicat.esss.se " ) ;
44- expect ( app . config . lbBaseUrl ) . toEqual ( "https://scicat.esss.se /api" ) ;
45- expect ( LoopBackConfig . getPath ( ) ) . toEqual ( "https://scicat.esss.se /api" ) ;
43+ expect ( app . config . scicatBaseUrl ) . toEqual ( "https://example.com/scicat " ) ;
44+ expect ( app . config . lbBaseUrl ) . toEqual ( "https://example.com /api" ) ;
45+ expect ( LoopBackConfig . getPath ( ) ) . toEqual ( "https://example.com /api" ) ;
4646 } ) ) ;
4747
4848 it ( `should navigate to home when clicking the title'` , ( ) => {
@@ -58,4 +58,25 @@ describe("AppComponent", () => {
5858 titleEl . nativeElement . click ( ) ;
5959 expect ( navigateSpy ) . toHaveBeenCalledWith ( [ "/" ] ) ;
6060 } ) ;
61+
62+ it ( "should render footer message links from config" , ( ) => {
63+ const fixture = TestBed . createComponent ( AppComponent ) ;
64+ fixture . detectChanges ( ) ;
65+
66+ const footerLinks = fixture . debugElement . query ( By . css ( ".footer-links" ) ) ;
67+ const anchors = footerLinks . queryAll ( By . css ( "a" ) ) ;
68+
69+ expect ( footerLinks . nativeElement . textContent ) . toContain (
70+ "For more information visit:" ,
71+ ) ;
72+ expect ( anchors . length ) . toBe ( 2 ) ;
73+ expect ( anchors [ 0 ] . nativeElement . textContent ) . toBe ( "Data policy" ) ;
74+ expect ( anchors [ 0 ] . nativeElement . href ) . toBe (
75+ "https://example.com/data-policy" ,
76+ ) ;
77+ expect ( anchors [ 1 ] . nativeElement . textContent ) . toBe ( "Documentation" ) ;
78+ expect ( anchors [ 1 ] . nativeElement . href ) . toBe (
79+ "https://example.com/documentation" ,
80+ ) ;
81+ } ) ;
6182} ) ;
0 commit comments