File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
src/LinkDotNet.Blog.Web/Shared
tests/LinkDotNet.Blog.IntegrationTests/Web/Shared Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 6
6
<div class =" container-fluid" >
7
7
@if (configuration .BlogBrandUrl != null )
8
8
{
9
- <a class =" nav-brand barcode ms-5" href =" /" >
10
- <img style =" max-height : 110 px ;"
9
+ <a class =" nav-brand ms-5" href =" /" >
10
+ <img style =" max-height : 62 px ;"
11
11
src =" @configuration.BlogBrandUrl.ToAbsoluteUrl(navigationManager.BaseUri)"
12
12
alt =" brand" />
13
13
</a >
Original file line number Diff line number Diff line change 1
1
using System . Linq ;
2
2
using AngleSharp . Html . Dom ;
3
+ using AngleSharpWrappers ;
3
4
using Bunit ;
4
5
using Bunit . TestDoubles ;
5
6
using FluentAssertions ;
@@ -81,8 +82,28 @@ public void ShouldPassCorrectUriToComponent()
81
82
this . AddTestAuthorization ( ) ;
82
83
var cut = RenderComponent < NavMenu > ( ) ;
83
84
84
- Services . GetService < NavigationManager > ( ) ! . NavigateTo ( "test" ) ;
85
+ Services . GetRequiredService < NavigationManager > ( ) . NavigateTo ( "test" ) ;
85
86
86
87
cut . FindComponent < AccessControl > ( ) . Instance . CurrentUri . Should ( ) . Contain ( "test" ) ;
87
88
}
89
+
90
+ [ Fact ]
91
+ public void ShouldShowBrandImageIfAvailable ( )
92
+ {
93
+ var config = new AppConfiguration
94
+ {
95
+ ProfileInformation = new ProfileInformation ( ) ,
96
+ BlogBrandUrl = "http://localhost/img.png" ,
97
+ } ;
98
+ Services . AddScoped ( _ => config ) ;
99
+ this . AddTestAuthorization ( ) ;
100
+
101
+ var cut = RenderComponent < NavMenu > ( ) ;
102
+
103
+ var brandImage = cut . Find ( ".nav-brand img" ) ;
104
+
105
+ var image = brandImage . Unwrap ( ) as IHtmlImageElement ;
106
+ image . Should ( ) . NotBeNull ( ) ;
107
+ image . Source . Should ( ) . Be ( "http://localhost/img.png" ) ;
108
+ }
88
109
}
You can’t perform that action at this time.
0 commit comments