File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
tests/LinkDotNet.Blog.IntegrationTests/Web/Shared/Skills Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -61,4 +61,20 @@ public async Task ShouldAddSkill()
61
61
fromRepo . Capability . Should ( ) . Be ( "capability" ) ;
62
62
fromRepo . ProficiencyLevel . Should ( ) . Be ( ProficiencyLevel . Expert ) ;
63
63
}
64
+
65
+ [ Fact ]
66
+ public async Task ShouldNotAllowToEditSkillTagsWhenNotAdmin ( )
67
+ {
68
+ using var ctx = new TestContext ( ) ;
69
+ var skill = new SkillBuilder ( ) . Build ( ) ;
70
+ await Repository . StoreAsync ( skill ) ;
71
+ ctx . Services . AddScoped < IRepository < Skill > > ( _ => Repository ) ;
72
+ ctx . Services . AddScoped ( _ => Mock . Of < IToastService > ( ) ) ;
73
+
74
+ var cut = ctx . RenderComponent < SkillTable > ( p =>
75
+ p . Add ( s => s . IsAuthenticated , false ) ) ;
76
+
77
+ cut . WaitForState ( ( ) => cut . FindComponents < SkillTag > ( ) . Any ( ) ) ;
78
+ cut . FindComponent < SkillTag > ( ) . Instance . IsAuthenticated . Should ( ) . BeFalse ( ) ;
79
+ }
64
80
}
You can’t perform that action at this time.
0 commit comments