Skip to content

Commit a39c05c

Browse files
committed
Fixed error where title is not filled up when updating a blog post
1 parent c185471 commit a39c05c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/LinkDotNet.Blog.Web/Shared/Admin/CreateNewBlogPost.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="mb-3">
1313
<label for="title">Title</label>
1414
<input class="form-control" id="title"
15-
@oninput="args => model.Title = args.Value.ToString()"/>
15+
@oninput="args => model.Title = args.Value.ToString()" value="@model.Title"/>
1616
</div>
1717
<div class="mb-3">
1818
<label for="short">Short Description</label>

tests/LinkDotNet.Blog.UnitTests/Web/Shared/Admin/CreateNewBlogPostTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ public void ShouldFillGivenBlogPost()
5757
p =>
5858
p.Add(c => c.OnBlogPostCreated, bp => blogPostFromComponent = bp)
5959
.Add(c => c.BlogPost, blogPost));
60-
cut.Find("#title").Input("My new Title");
6160

6261
cut.Find("form").Submit();
6362

6463
cut.WaitForState(() => cut.Find("#title").TextContent == string.Empty);
6564
blogPostFromComponent.Should().NotBeNull();
66-
blogPostFromComponent.Title.Should().Be("My new Title");
65+
blogPostFromComponent.Title.Should().Be("Title");
6766
blogPostFromComponent.ShortDescription.Should().Be("Desc");
6867
blogPostFromComponent.Content.Should().Be("Content");
6968
blogPostFromComponent.Tags.Select(t => t.Content).Should().Contain("tag1");

0 commit comments

Comments
 (0)