Skip to content

Commit d3d66fa

Browse files
committed
Fixes #44
1 parent ed5f6c3 commit d3d66fa

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
<ValidationSummary />
1111
<div class="mb-3">
1212
<label for="title">Title</label>
13-
<InputText class="form-control" id="title" @bind-Value="model.Title"
13+
<input class="form-control" id="title" value="@model.Title"
1414
@oninput="args => model.Title = args.Value.ToString()"/>
1515
</div>
1616
<div class="mb-3">
1717
<label for="short">Short Description</label>
18-
<InputTextArea class="form-control" id="short" @bind-Value="model.ShortDescription" rows="4"
18+
<input class="form-control" id="short" rows="4" value="@model.ShortDescription"
1919
@oninput="args => model.ShortDescription = args.Value.ToString()"/>
2020
<small for="short" class="form-text text-muted">You can use markdown to style your component.</small>
2121
</div>
2222
<div class="mb-3">
2323
<label for="content">Content</label>
24-
<InputTextArea class="form-control" id="content" @bind-Value="model.Content" @oninput="args => model.Content = args.Value.ToString()" rows="10" />
24+
<textarea class="form-control" id="content" @oninput="args => model.Content = args.Value.ToString()" rows="10">@model.Content</textarea>
2525
<small for="content" class="form-text text-muted">You can use markdown to style your component. Additional features are listed <a @onclick="@(() => FeatureDialog.Open())">here</a></small>
2626
<UploadFile OnFileUploaded="SetContentFromFile" id="content-upload"></UploadFile>
2727
<small for="content-upload" class="form-text text-muted">Drag and drop markdown files to upload and
@@ -93,6 +93,7 @@
9393
}
9494

9595
model = CreateNewModel.FromBlogPost(BlogPost);
96+
9697
}
9798

9899
private async Task OnValidBlogPostCreatedAsync()

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/CreateNewBlogPostPageTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public async Task ShouldSaveBlogPostOnSave()
4141

4242
private static void TriggerNewBlogPost(IRenderedComponent<CreateNewBlogPost> cut)
4343
{
44-
cut.Find("#title").Change("My Title");
45-
cut.Find("#short").Change("My short Description");
46-
cut.Find("#content").Change("My content");
44+
cut.Find("#title").Input("My Title");
45+
cut.Find("#short").Input("My short Description");
46+
cut.Find("#content").Input("My content");
4747
cut.Find("#preview").Change("My preview url");
4848
cut.Find("#published").Change(false);
4949
cut.Find("#tags").Change("Tag1,Tag2,Tag3");

tests/LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin/UpdateBlogPostPageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void ShouldThrowWhenNoIdProvided()
5858

5959
private static void TriggerUpdate(IRenderedFragment cut)
6060
{
61-
cut.Find("#short").Change("My new Description");
61+
cut.Find("#short").Input("My new Description");
6262

6363
cut.Find("form").Submit();
6464
}

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public void ShouldCreateNewBlogPostWhenValidDataGiven()
2323
BlogPost blogPost = null;
2424
var cut = RenderComponent<CreateNewBlogPost>(
2525
p => p.Add(c => c.OnBlogPostCreated, bp => blogPost = bp));
26-
cut.Find("#title").Change("My Title");
27-
cut.Find("#short").Change("My short Description");
28-
cut.Find("#content").Change("My content");
26+
cut.Find("#title").Input("My Title");
27+
cut.Find("#short").Input("My short Description");
28+
cut.Find("#content").Input("My content");
2929
cut.Find("#preview").Change("My preview url");
3030
cut.Find("#published").Change(false);
3131
cut.Find("#tags").Change("Tag1,Tag2,Tag3");
@@ -57,7 +57,7 @@ public void ShouldFillGivenBlogPost()
5757
p =>
5858
p.Add(c => c.OnBlogPostCreated, bp => blogPostFromComponent = bp)
5959
.Add(c => c.BlogPost, blogPost));
60-
cut.Find("#title").Change("My new Title");
60+
cut.Find("#title").Input("My new Title");
6161

6262
cut.Find("form").Submit();
6363

@@ -77,9 +77,9 @@ public void ShouldNotDeleteModelWhenSet()
7777
var cut = RenderComponent<CreateNewBlogPost>(
7878
p => p.Add(c => c.ClearAfterCreated, true)
7979
.Add(c => c.OnBlogPostCreated, post => blogPost = post));
80-
cut.Find("#title").Change("My Title");
81-
cut.Find("#short").Change("My short Description");
82-
cut.Find("#content").Change("My content");
80+
cut.Find("#title").Input("My Title");
81+
cut.Find("#short").Input("My short Description");
82+
cut.Find("#content").Input("My content");
8383
cut.Find("#preview").Change("My preview url");
8484
cut.Find("#tags").Change("Tag1,Tag2,Tag3");
8585
cut.Find("form").Submit();
@@ -97,9 +97,9 @@ public void ShouldNotDeleteModelWhenNotSet()
9797
var cut = RenderComponent<CreateNewBlogPost>(
9898
p => p.Add(c => c.ClearAfterCreated, false)
9999
.Add(c => c.OnBlogPostCreated, post => blogPost = post));
100-
cut.Find("#title").Change("My Title");
101-
cut.Find("#short").Change("My short Description");
102-
cut.Find("#content").Change("My content");
100+
cut.Find("#title").Input("My Title");
101+
cut.Find("#short").Input("My short Description");
102+
cut.Find("#content").Input("My content");
103103
cut.Find("#preview").Change("My preview url");
104104
cut.Find("#tags").Change("Tag1,Tag2,Tag3");
105105
cut.Find("form").Submit();
@@ -121,9 +121,9 @@ public void ShouldNotUpdateUpdatedDateWhenCheckboxSet()
121121
p.Add(c => c.OnBlogPostCreated, bp => blogPostFromComponent = bp)
122122
.Add(c => c.BlogPost, originalBlogPost));
123123

124-
cut.Find("#title").Change("My Title");
125-
cut.Find("#short").Change("My short Description");
126-
cut.Find("#content").Change("My content");
124+
cut.Find("#title").Input("My Title");
125+
cut.Find("#short").Input("My short Description");
126+
cut.Find("#content").Input("My content");
127127
cut.Find("#preview").Change("My preview url");
128128
cut.Find("#tags").Change("Tag1,Tag2,Tag3");
129129
cut.Find("#updatedate").Change(false);

0 commit comments

Comments
 (0)