File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tests/LinkDotNet.Blog.IntegrationTests/Web/Shared/Skills Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -94,4 +94,24 @@ public async Task ShouldUpdateProficiencyWhenSkillTagDragged()
94
94
var skillFromDb = await Repository . GetByIdAsync ( skill . Id ) ;
95
95
skillFromDb . ProficiencyLevel . Should ( ) . Be ( ProficiencyLevel . Proficient ) ;
96
96
}
97
+
98
+ [ Fact ]
99
+ public async Task ShouldStayOnSameProficiencyWhenDroppedOnSameProficiencyLevel ( )
100
+ {
101
+ using var ctx = new TestContext ( ) ;
102
+ var skill = new SkillBuilder ( ) . WithProficiencyLevel ( ProficiencyLevel . Familiar ) . Build ( ) ;
103
+ await DbContext . AddAsync ( skill ) ;
104
+ await DbContext . SaveChangesAsync ( ) ;
105
+ ctx . Services . AddScoped < IRepository < Skill > > ( _ => Repository ) ;
106
+ ctx . Services . AddScoped ( _ => Mock . Of < IToastService > ( ) ) ;
107
+ var cut = ctx . RenderComponent < SkillTable > ( p =>
108
+ p . Add ( s => s . IsAuthenticated , true ) ) ;
109
+ cut . WaitForState ( ( ) => cut . FindAll ( ".skill-tag" ) . Any ( ) ) ;
110
+
111
+ cut . FindAll ( ".skill-tag" ) [ 0 ] . Drag ( ) ;
112
+ cut . FindAll ( ".proficiency-level" ) [ 0 ] . Drop ( ) ;
113
+
114
+ var skillFromDb = await Repository . GetByIdAsync ( skill . Id ) ;
115
+ skillFromDb . ProficiencyLevel . Should ( ) . Be ( ProficiencyLevel . Familiar ) ;
116
+ }
97
117
}
You can’t perform that action at this time.
0 commit comments