Skip to content

Commit 762b8ab

Browse files
committed
fix tests
1 parent 8092539 commit 762b8ab

File tree

6 files changed

+41
-0
lines changed

6 files changed

+41
-0
lines changed

design/settings.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,15 @@ <h3 class="set-section-title">About</h3>
12371237
<div class="set-toggle on"><div class="set-toggle-thumb"></div></div>
12381238
</div>
12391239
</div>
1240+
<div class="set-device-fields">
1241+
<a class="set-about-link set-field set-field-toggle" href="https://github.com/managedcode/PrompterOne" target="_blank" rel="noreferrer">
1242+
<div class="set-about-link-copy">
1243+
<label>PrompterOne on GitHub</label>
1244+
<span class="set-about-link-meta">Source code, docs, and milestones</span>
1245+
</div>
1246+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--t4)" stroke-width="2"><polyline points="9,18 15,12 9,6"/></svg>
1247+
</a>
1248+
</div>
12401249
</div>
12411250
</div>
12421251

src/PrompterOne.Shared/Contracts/UiTestIds.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ public static class Settings
226226
public const string AboutCompanyGitHub = "settings-about-company-github";
227227
public const string AboutCompanyWebsite = "settings-about-company-website";
228228
public const string AboutPanel = "settings-about-panel";
229+
public const string AboutProductGitHub = "settings-about-product-github";
229230
public const string AboutProductWebsite = "settings-about-product-website";
230231
public const string AboutRepositoryLink = "settings-about-repository-link";
231232
public const string AboutReleasesLink = "settings-about-releases-link";

src/PrompterOne.Shared/Settings/Components/SettingsAboutSection.razor

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@
3232
</div>
3333
</div>
3434
</div>
35+
<div class="set-device-fields">
36+
@foreach (var link in AppLinks)
37+
{
38+
<a class="set-about-link set-field set-field-toggle"
39+
href="@link.Href"
40+
target="_blank"
41+
rel="noreferrer"
42+
data-testid="@link.TestId">
43+
<div class="set-about-link-copy">
44+
<label>@link.Label</label>
45+
<span class="set-about-link-meta">@link.Description</span>
46+
</div>
47+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--t4)" stroke-width="2">
48+
<polyline points="9,18 15,12 9,6" />
49+
</svg>
50+
</a>
51+
}
52+
</div>
3553
</SettingsExpandableCard>
3654

3755
<SettingsExpandableCard Title="@ManagedCodeCardTitle"

src/PrompterOne.Shared/Settings/Components/SettingsAboutSection.razor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ public partial class SettingsAboutSection
2626
private const string SoftwareUpdatesLabel = "Software Updates";
2727
private const string UpToDateLabel = "Up to date";
2828

29+
private static readonly AboutLinkItem[] AppLinks =
30+
[
31+
new(
32+
UiTestIds.Settings.AboutProductGitHub,
33+
"PrompterOne on GitHub",
34+
"Source code, docs, and milestones",
35+
AboutLinks.ProductRepositoryUrl)
36+
];
37+
2938
private static readonly AboutLinkItem[] CompanyLinks =
3039
[
3140
new(

tests/PrompterOne.App.Tests/Settings/SettingsInteractionTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ public void AboutSection_RendersInjectedAppVersionMetadata_AndOfficialManagedCod
307307
Assert.Equal(
308308
AboutLinks.ManagedCodeGitHubUrl,
309309
cut.FindByTestId(UiTestIds.Settings.AboutCompanyGitHub).GetAttribute("href"));
310+
Assert.Equal(
311+
AboutLinks.ProductRepositoryUrl,
312+
cut.FindByTestId(UiTestIds.Settings.AboutProductGitHub).GetAttribute("href"));
310313
Assert.Equal(
311314
AboutLinks.ProductWebsiteUrl,
312315
cut.FindByTestId(UiTestIds.Settings.AboutProductWebsite).GetAttribute("href"));

tests/PrompterOne.App.UITests/Teleprompter/TeleprompterSettingsFlowTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ await Expect(page.Locator("html")).ToHaveAttributeAsync(
186186
await Expect(page.GetByTestId(UiTestIds.Settings.AboutVersion)).ToHaveTextAsync(BrowserTestConstants.Regexes.SettingsAboutVersion);
187187
await Expect(page.GetByTestId(UiTestIds.Settings.AboutCompanyWebsite)).ToHaveAttributeAsync("href", AboutLinks.ManagedCodeWebsiteUrl);
188188
await Expect(page.GetByTestId(UiTestIds.Settings.AboutCompanyGitHub)).ToHaveAttributeAsync("href", AboutLinks.ManagedCodeGitHubUrl);
189+
await Expect(page.GetByTestId(UiTestIds.Settings.AboutProductGitHub)).ToHaveAttributeAsync("href", AboutLinks.ProductRepositoryUrl);
189190
await Expect(page.GetByTestId(UiTestIds.Settings.AboutRepositoryLink)).ToHaveAttributeAsync("href", AboutLinks.ProductRepositoryUrl);
190191
await Expect(page.GetByTestId(UiTestIds.Settings.AboutReleasesLink)).ToHaveAttributeAsync("href", AboutLinks.ProductReleasesUrl);
191192
await Expect(page.GetByTestId(UiTestIds.Settings.AboutIssuesLink)).ToHaveAttributeAsync("href", AboutLinks.ProductIssuesUrl);

0 commit comments

Comments
 (0)