Skip to content

Commit

Permalink
formatting about page (#58)
Browse files Browse the repository at this point in the history
* formatting about page

* test 'setup/teardown'
  • Loading branch information
eebbesen authored Dec 19, 2024
1 parent d50048d commit c7ede69
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
23 changes: 14 additions & 9 deletions StpFoodBlazor/StpFoodBlazor/Components/Pages/About.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

<PageTitle>About</PageTitle>

<h1>Downtown Saint Paul Deals</h1>
<div class="container">
Downtown Saint Paul food and drink deals compiled by
<ul>
<li>Visiting establishments</li>
<li>Subscribing to mailing lists of establishments</li>
<li>Participating in rewards programs for establishments (e.g., phone app notifications)</li>
</ul>
<div>
See the code <a href="https://github.com/eebbesen/StpFoodBlazor"> here</a>
<h1>Downtown Saint Paul Deals</h1>
<div class="container">
Downtown Saint Paul food and drink deals compiled by
<ul>
<li>Visiting establishments</li>
<li>Subscribing to mailing lists of establishments</li>
<li>Participating in rewards programs for establishments (e.g., phone app notifications)</li>
</ul>
<div>
Also gift card deals :).
</div>
<div>
See the code <a href="https://github.com/eebbesen/StpFoodBlazor"> here</a>
</div>
</div>
</div>
26 changes: 19 additions & 7 deletions StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
ctx.Services.AddSingleton<ITimeService>(timeService);
}

public void Dispose(){

Check warning on line 21 in StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor

View workflow job for this annotation

GitHub Actions / test

Public method 'Dispose' on test class 'DealsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 21 in StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor

View workflow job for this annotation

GitHub Actions / test

Public method 'Dispose' on test class 'DealsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 21 in StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor

View workflow job for this annotation

GitHub Actions / build

Public method 'Dispose' on test class 'DealsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 21 in StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor

View workflow job for this annotation

GitHub Actions / build

Public method 'Dispose' on test class 'DealsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)
// so that TestDealService attributes are reset
}

[Fact]
public void DealsShouldDisplayPlaceholderWhenLoading()
{
Expand Down Expand Up @@ -98,7 +102,8 @@
{
ctx.Services.AddSingleton<ITimeService>(timeService);
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");
getElements(cut); // just to make sure table is rendered
Assert.Equal(DateTime.Today.DayOfWeek.ToString(), dowSelect.Value);
Expand All @@ -108,9 +113,11 @@
public void DealsShouldChangeWhenNewValueSelectedMonday()
{
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");

dowSelect.Change("Monday");
@* cut.WaitForState(() => cut.Find("#day-of-week-select").TextContent == "Monday"); *@

var elements = getElements(cut);
Assert.Equal(16, elements.ChildElementCount);
Expand All @@ -120,7 +127,8 @@
public void DealsShouldChangeWhenNewValueSelectedFriday()
{
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");

dowSelect.Change("Friday");

Expand All @@ -132,7 +140,8 @@
public void DealsShouldSortByDay()
{
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");

dowSelect.Change(""); // All value in the select is ""
Expand All @@ -146,7 +155,8 @@
public void DealsShouldShowDayColumnWhenAllDays()
{
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");

dowSelect.Change(""); // All value in the select is ""
Expand All @@ -161,7 +171,8 @@
public void DealsShouldNotShowDayColumnWhenNotAllDays()
{
var cut = ctx.Render(@<Deals />);
var dowSelect = (IHtmlSelectElement)cut.WaitForElement("#day-of-week-select");
cut.WaitForElement("#day-of-week-select");
var dowSelect = (IHtmlSelectElement)cut.Find("#day-of-week-select");

dowSelect.Change("Friday");

Expand Down Expand Up @@ -191,6 +202,7 @@

private IElement getElements(IRenderedFragment cut)
{
return cut.WaitForElement("#deals_table_body", TimeSpan.FromSeconds(5));
cut.WaitForElement("#deals_table_body", TimeSpan.FromSeconds(5));
return cut.Find("#deals_table_body");
}
}
4 changes: 4 additions & 0 deletions StpFoodBlazor/StpFoodBlazorTest/Pages/GiftCardsTest.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
ctx.Services.AddSingleton<ITimeService>(timeService);
}

public void Dispose(){

Check warning on line 20 in StpFoodBlazor/StpFoodBlazorTest/Pages/GiftCardsTest.razor

View workflow job for this annotation

GitHub Actions / test

Public method 'Dispose' on test class 'GiftCardsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 20 in StpFoodBlazor/StpFoodBlazorTest/Pages/GiftCardsTest.razor

View workflow job for this annotation

GitHub Actions / test

Public method 'Dispose' on test class 'GiftCardsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 20 in StpFoodBlazor/StpFoodBlazorTest/Pages/GiftCardsTest.razor

View workflow job for this annotation

GitHub Actions / build

Public method 'Dispose' on test class 'GiftCardsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 20 in StpFoodBlazor/StpFoodBlazorTest/Pages/GiftCardsTest.razor

View workflow job for this annotation

GitHub Actions / build

Public method 'Dispose' on test class 'GiftCardsTest' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)
// so that TestDealService attributes are reset
}

[Fact]
public void GiftCardsShouldDisplayPlaceholderWhenLoading()
{
Expand Down

0 comments on commit c7ede69

Please sign in to comment.