Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 859bb8544a | |||
| 9795a491e0 | |||
| a6a95e81d0 | |||
| 910573f836 | |||
| 7a2b8a95c1 |
@@ -5,6 +5,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||||
|
<DefaultItemExcludes>$(DefaultItemExcludes);PdfBrowserStub/**</DefaultItemExcludes>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -24,14 +25,19 @@
|
|||||||
<ProjectReference Include="..\JobTrackerApi\JobTrackerApi.csproj" />
|
<ProjectReference Include="..\JobTrackerApi\JobTrackerApi.csproj" />
|
||||||
<!-- Build the fixture, but only our explicit subdirectory copy owns its output.
|
<!-- Build the fixture, but only our explicit subdirectory copy owns its output.
|
||||||
The Linux apphost has no .exe suffix and collides with that directory if copied to root. -->
|
The Linux apphost has no .exe suffix and collides with that directory if copied to root. -->
|
||||||
<ProjectReference Include="PdfBrowserStub/PdfBrowserStub.csproj" ReferenceOutputAssembly="false" Private="false" />
|
<ProjectReference Include="PdfBrowserStub/PdfBrowserStub.csproj" ReferenceOutputAssembly="false" Private="false" OutputItemType="PdfBrowserStubAssembly" />
|
||||||
<Compile Remove="PdfBrowserStub/**/*.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyPdfBrowserStub" AfterTargets="Build">
|
<Target Name="CopyPdfBrowserStub" AfterTargets="Build">
|
||||||
|
<Error Condition="'@(PdfBrowserStubAssembly)' == ''" Text="The PDF browser stub project returned no output assembly." />
|
||||||
|
<PropertyGroup>
|
||||||
|
<PdfBrowserStubOutput>@(PdfBrowserStubAssembly->'%(RootDir)%(Directory)%(Filename)')</PdfBrowserStubOutput>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PdfBrowserFiles Include="PdfBrowserStub/bin/$(Configuration)/net9.0/*" />
|
<PdfBrowserFiles Include="$(PdfBrowserStubOutput).*" />
|
||||||
|
<!-- The Unix apphost is the only fixture file without an extension. -->
|
||||||
|
<PdfBrowserFiles Include="$(PdfBrowserStubOutput)" Condition="$([System.IO.File]::Exists('$(PdfBrowserStubOutput)'))" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Copy SourceFiles="@(PdfBrowserFiles)" DestinationFolder="$(TargetDir)PdfBrowserStub" />
|
<Copy SourceFiles="@(PdfBrowserFiles)" DestinationFolder="$(TargetDir)PdfBrowserStub" SkipUnchangedFiles="true" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -934,6 +934,32 @@ public sealed class ProfileCvControllerTests
|
|||||||
Assert.Contains("42", json, StringComparison.OrdinalIgnoreCase);
|
Assert.Contains("42", json, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("Expérience", "Expe\u0301rience", "## Éducation")]
|
||||||
|
[InlineData("Γλώσσες", "Γλώσσες", "## Εκπαίδευση")]
|
||||||
|
[InlineData("Språk", "Languages", "## Utdanning")]
|
||||||
|
[InlineData("Portfolio – 2026", "Portfolio – 2026", "## Certificates")]
|
||||||
|
[InlineData("Expérience", "Expérience", "Projets supplémentaires")]
|
||||||
|
[InlineData("Språk", "Languages", "Utdanning:")]
|
||||||
|
public async Task Rewrite_preview_replaces_only_the_selected_document_section(string heading, string selected, string nextHeading)
|
||||||
|
{
|
||||||
|
var source = $"## {heading}\r\n\r\nTravail en équipe\r\nOriginal work.\r\n{nextHeading}\r\nKeep this content.";
|
||||||
|
var user = new ApplicationUser { Id = "user-1", ProfileCvText = source };
|
||||||
|
var users = CreateUserManager();
|
||||||
|
users.Setup(x => x.GetUserAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(user);
|
||||||
|
var ai = new Mock<ISummarizerService>();
|
||||||
|
ai.Setup(x => x.SummarizeSectionAsync(It.IsAny<string>(), It.IsAny<string>(), 900, 180))
|
||||||
|
.ReturnsAsync("Updated work.");
|
||||||
|
await using var db = CreateDb();
|
||||||
|
var controller = CreateController(users.Object, ai.Object, db, CreatePaths());
|
||||||
|
var action = await controller.BuildRewritePreview(new ProfileCvController.RewriteSectionRequest { SectionName = selected });
|
||||||
|
var preview = Assert.IsType<ProfileCvPreviewDto>(Assert.IsType<OkObjectResult>(action.Result).Value);
|
||||||
|
|
||||||
|
Assert.Equal($"## {heading}\nUpdated work.\n\n{nextHeading}\nKeep this content.", preview.FullText.ReplaceLineEndings("\n"));
|
||||||
|
ai.Verify(x => x.SummarizeSectionAsync(It.IsAny<string>(), It.Is<string>(text => text.Contains("Original work.") && !text.Contains("Keep this content.")), 900, 180), Times.Once);
|
||||||
|
Assert.Equal(source, user.ProfileCvText);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Parse_returns_structured_cv_and_persists_it()
|
public async Task Parse_returns_structured_cv_and_persists_it()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -581,6 +581,9 @@ public sealed partial class ProfileCvController : ControllerBase
|
|||||||
: string.Join("\n\n", structuredCv.Sections.Select(section => $"## {section.Name}\n{section.Content}"));
|
: string.Join("\n\n", structuredCv.Sections.Select(section => $"## {section.Name}\n{section.Content}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sourceText is not null && FindRewriteSection(sourceText, sectionName) is { } range)
|
||||||
|
return sourceText[range.Start..range.End].Trim();
|
||||||
|
|
||||||
var matchingSection = structuredCv.Sections.FirstOrDefault(section => string.Equals(section.Name, sectionName, StringComparison.OrdinalIgnoreCase));
|
var matchingSection = structuredCv.Sections.FirstOrDefault(section => string.Equals(section.Name, sectionName, StringComparison.OrdinalIgnoreCase));
|
||||||
if (matchingSection is not null && !string.IsNullOrWhiteSpace(matchingSection.Content))
|
if (matchingSection is not null && !string.IsNullOrWhiteSpace(matchingSection.Content))
|
||||||
{
|
{
|
||||||
@@ -618,6 +621,33 @@ public sealed partial class ProfileCvController : ControllerBase
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly Regex RewriteHeading = new(
|
||||||
|
@"^(?:(?<marker>#{1,2})[ \t]+(?<name>[^\r\n]+?)|(?<name>[\p{Lu}\p{Lt}][\p{L}\p{M} &/]+?))(?<colon>:)?[ \t]*\r?$",
|
||||||
|
RegexOptions.Multiline | RegexOptions.CultureInvariant);
|
||||||
|
|
||||||
|
private static (int Start, int End, string Name)? FindRewriteSection(string text, string sectionName)
|
||||||
|
{
|
||||||
|
var target = NormalizeRewriteSectionName(sectionName.Normalize());
|
||||||
|
foreach (Match heading in RewriteHeading.Matches(text))
|
||||||
|
{
|
||||||
|
var name = heading.Groups["name"].Value.Trim();
|
||||||
|
if (!string.Equals(NormalizeRewriteSectionName(name.Normalize()), target, StringComparison.OrdinalIgnoreCase))
|
||||||
|
continue;
|
||||||
|
var next = heading.NextMatch();
|
||||||
|
if (heading.Groups["marker"].Success && next.Success &&
|
||||||
|
!next.Groups["marker"].Success && !next.Groups["colon"].Success &&
|
||||||
|
!SectionAliases.ContainsKey(next.Groups["name"].Value.Trim()))
|
||||||
|
{
|
||||||
|
// The first unmarked line may be prose. Preserve later legacy headings even without a blank separator.
|
||||||
|
var bodyStart = heading.Index + heading.Length;
|
||||||
|
if (text.AsSpan(bodyStart, next.Index - bodyStart).Trim().IsEmpty)
|
||||||
|
next = next.NextMatch();
|
||||||
|
}
|
||||||
|
return (heading.Index, next.Success ? next.Index : text.Length, name);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private static string ReplaceOrAppendCvSection(string source, string sectionName, string sectionDraft)
|
private static string ReplaceOrAppendCvSection(string source, string sectionName, string sectionDraft)
|
||||||
{
|
{
|
||||||
var trimmedSource = (source ?? string.Empty).Trim();
|
var trimmedSource = (source ?? string.Empty).Trim();
|
||||||
@@ -625,20 +655,14 @@ public sealed partial class ProfileCvController : ControllerBase
|
|||||||
if (string.IsNullOrWhiteSpace(trimmedDraft)) return trimmedSource;
|
if (string.IsNullOrWhiteSpace(trimmedDraft)) return trimmedSource;
|
||||||
if (string.IsNullOrWhiteSpace(trimmedSource)) return $"## {sectionName}\n{trimmedDraft}";
|
if (string.IsNullOrWhiteSpace(trimmedSource)) return $"## {sectionName}\n{trimmedDraft}";
|
||||||
|
|
||||||
var normalizedHeading = sectionName.Trim().ToLowerInvariant();
|
if (FindRewriteSection(trimmedSource, sectionName) is not { } range)
|
||||||
var headingPattern = new Regex(@"^(##\s+|#\s+)?(?<name>[A-Z][A-Za-z &/]+):?\s*$", RegexOptions.Multiline);
|
|
||||||
var matches = headingPattern.Matches(trimmedSource).ToList();
|
|
||||||
var targetIndex = matches.FindIndex(match => string.Equals(match.Groups["name"].Value.Trim(), normalizedHeading, StringComparison.OrdinalIgnoreCase));
|
|
||||||
if (targetIndex < 0)
|
|
||||||
{
|
{
|
||||||
return $"{trimmedSource}\n\n## {sectionName}\n{trimmedDraft}".Trim();
|
return $"{trimmedSource}\n\n## {sectionName}\n{trimmedDraft}".Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
var start = matches[targetIndex].Index;
|
var before = trimmedSource[..range.Start].TrimEnd();
|
||||||
var end = targetIndex + 1 < matches.Count ? matches[targetIndex + 1].Index : trimmedSource.Length;
|
var after = trimmedSource[range.End..].TrimStart();
|
||||||
var before = trimmedSource[..start].TrimEnd();
|
return string.Join("\n\n", new[] { before, $"## {range.Name}\n{trimmedDraft}", after }.Where(part => !string.IsNullOrWhiteSpace(part))).Trim();
|
||||||
var after = trimmedSource[end..].TrimStart();
|
|
||||||
return string.Join("\n\n", new[] { before, $"## {sectionName}\n{trimmedDraft}", after }.Where(part => !string.IsNullOrWhiteSpace(part))).Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IReadOnlyList<CvTemplateDescriptor> GetCvTemplateDescriptors()
|
private static IReadOnlyList<CvTemplateDescriptor> GetCvTemplateDescriptors()
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# PDF admission test fixture
|
||||||
|
|
||||||
|
Verified on Windows x64 with SDK 9.0.317, VSTest 17.14.1 and a locked restore from the local NuGet package cache. The source baseline was `245f2feaa8bee2db8f5da0797b3e33f6ef8b056e`.
|
||||||
|
|
||||||
|
| Build | Test selection | Result |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Before fix, Release with a fresh `--artifacts-path` | `Default_limit_refuses_second_actual_browser_until_first_exits` | FAILED. The SDK built the stub in the requested location. The test output lacked the stub and the exporter reported that no browser was available. |
|
||||||
|
| After fix, Release with a fresh `--artifacts-path` | `PdfRenderAdmissionTests` | PASSED, 22 of 22. |
|
||||||
|
| After fix, Debug with the conventional output directory | `PdfRenderAdmissionTests` | PASSED, the same 22 of 22. |
|
||||||
|
|
||||||
|
Both successful runs built and launched the fixture through `dotnet test`. In each output layout the fixture directory contained exactly the apphost, assembly, symbols, dependency manifest and runtime configuration. All five SHA-256 hashes matched the corresponding stub project output. The conventional stub project's `bin` and `obj` directories already existed during the final relocated run and were excluded from the test content.
|
||||||
|
|
||||||
|
To repeat with restored dependencies, use `dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj -c Debug --filter FullyQualifiedName~PdfRenderAdmissionTests`. For the relocated case, use `-c Release` and add `--artifacts-path <fresh-directory>`.
|
||||||
|
|
||||||
|
These tests exercise local process admission, cancellation and cleanup with the synthetic browser. Linux execution, visual PDF acceptance and production rendering remain separate qualifications.
|
||||||
@@ -10,6 +10,8 @@ python -m http.server 4327 --bind 127.0.0.1 --directory docs/ui-modernisation/re
|
|||||||
|
|
||||||
## Compare the experiences
|
## Compare the experiences
|
||||||
|
|
||||||
|
Browser Back and Forward retrace screens and selected opportunities within a concept. For example, open a filtered job, enter its CV workspace and go back twice to return to the filtered results. The ten desktop/phone selected-job journeys exercised this round trip and its forward path on 20 November. Drafts and filters are held in memory for the review session.
|
||||||
|
|
||||||
| Direction | First interaction | Desktop and phone | Implementation implication |
|
| Direction | First interaction | Desktop and phone | Implementation implication |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| A · Clear Desk | Scan the activity list and agenda | Compact top navigation, high density, horizontally scrollable on a phone | Existing tracker and agenda owners fit. Check legibility as text size increases. |
|
| A · Clear Desk | Scan the activity list and agenda | Compact top navigation, high density, horizontally scrollable on a phone | Existing tracker and agenda owners fit. Check legibility as text size increases. |
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const $ = (s) => document.querySelector(s),
|
const $ = (s) => document.querySelector(s);
|
||||||
q = new URLSearchParams(location.search);
|
|
||||||
const screens = [
|
const screens = [
|
||||||
"home",
|
"home",
|
||||||
"discover",
|
"discover",
|
||||||
@@ -14,14 +13,20 @@ const screens = [
|
|||||||
"admin",
|
"admin",
|
||||||
"onboarding",
|
"onboarding",
|
||||||
];
|
];
|
||||||
const selected = (key, allowed, fallback) =>
|
function routeFromLocation() {
|
||||||
allowed.includes(q.get(key)) ? q.get(key) : fallback;
|
const query = new URLSearchParams(location.search);
|
||||||
|
const selected = (key, allowed, fallback) =>
|
||||||
|
allowed.includes(query.get(key)) ? query.get(key) : fallback;
|
||||||
|
return {
|
||||||
|
concept: selected("concept", "ABCDE".split(""), ""),
|
||||||
|
screen: selected("screen", screens, "home"),
|
||||||
|
lang: selected("lang", ["en", "nb"], "en"),
|
||||||
|
theme: selected("theme", ["light", "dark"], "light"),
|
||||||
|
phone: query.get("mobile") === "1",
|
||||||
|
};
|
||||||
|
}
|
||||||
const state = {
|
const state = {
|
||||||
concept: selected("concept", "ABCDE".split(""), ""),
|
...routeFromLocation(),
|
||||||
screen: selected("screen", screens, "home"),
|
|
||||||
lang: selected("lang", ["en", "nb"], "en"),
|
|
||||||
theme: selected("theme", ["light", "dark"], "light"),
|
|
||||||
phone: q.get("mobile") === "1",
|
|
||||||
calendarView: "agenda",
|
calendarView: "agenda",
|
||||||
trackerView: "list",
|
trackerView: "list",
|
||||||
query: "",
|
query: "",
|
||||||
@@ -343,7 +348,11 @@ const records = jobs.map((job, i) => ({
|
|||||||
function trackedCount() {
|
function trackedCount() {
|
||||||
return records.filter((r) => r.stage === "saved").length;
|
return records.filter((r) => r.stage === "saved").length;
|
||||||
}
|
}
|
||||||
let current = records.find((r) => r.id === q.get("job")) || records[0];
|
function jobFromLocation() {
|
||||||
|
const id = new URLSearchParams(location.search).get("job");
|
||||||
|
return records.find((r) => r.id === id) || records[0];
|
||||||
|
}
|
||||||
|
let current = jobFromLocation();
|
||||||
const detailText = [
|
const detailText = [
|
||||||
[
|
[
|
||||||
"Coordinate community care, support families and work with local healthcare teams.",
|
"Coordinate community care, support families and work with local healthcare teams.",
|
||||||
@@ -550,7 +559,7 @@ function gallery() {
|
|||||||
"",
|
"",
|
||||||
)}</div><section style="margin-top:45px"><h2>What to compare</h2><p>Try finding a job, saving it, preparing a CV, reviewing a letter and scheduling a follow-up. Switch between desktop and mobile, English and Bokmål, light and dark. These are design prototypes with synthetic data, not provider or production qualification.</p><a href="compare.html">Compare screenshots and tradeoffs</a> · <a href="RESEARCH.md">Research notes</a></section></main>`;
|
)}</div><section style="margin-top:45px"><h2>What to compare</h2><p>Try finding a job, saving it, preparing a CV, reviewing a letter and scheduling a follow-up. Switch between desktop and mobile, English and Bokmål, light and dark. These are design prototypes with synthetic data, not provider or production qualification.</p><a href="compare.html">Compare screenshots and tradeoffs</a> · <a href="RESEARCH.md">Research notes</a></section></main>`;
|
||||||
}
|
}
|
||||||
function render() {
|
function render(navigating = false) {
|
||||||
if (!state.concept) {
|
if (!state.concept) {
|
||||||
$("#app").innerHTML = gallery();
|
$("#app").innerHTML = gallery();
|
||||||
return;
|
return;
|
||||||
@@ -607,20 +616,26 @@ function render() {
|
|||||||
.join(
|
.join(
|
||||||
"",
|
"",
|
||||||
)}</select></label><label><select aria-label="Language" id="lang"><option value="en" ${state.lang === "en" ? "selected" : ""}>English</option><option value="nb" ${state.lang === "nb" ? "selected" : ""}>Norsk</option></select></label><button data-action="theme">${state.theme === "dark" ? "☀ Light" : "☾ Dark"}</button><button data-action="mobile">${state.phone ? t("desktop") : t("mobile")}</button></div><div class="shell"><header class="top"><a class="brand" href="#" data-screen="home"><span>${state.concept === "E" ? "↗" : "j"}</span>${c.name}</a><nav class="nav" aria-label="Primary">${nav.map((s) => link(s, t(s), state.screen === s ? "active" : "")).join("")}</nav><div class="actions">${link("mail", "✉ " + t("mail"))}${link("settings", t("settings"))}<span class="avatar">AO</span></div></header><main class="content" id="main">${(screens[state.screen] || home)()}<details style="margin-top:35px"><summary>${t("help")}</summary><div class="actions" style="margin-top:12px">${["cv", "letter", "mail", "settings", "admin", "onboarding"].map((s) => link(s, t(s))).join("")}</div></details></main>${state.concept === "E" ? `<nav class="journey-nav" aria-label="Journey">${["home", "discover", "applications", "profile", "calendar"].map((s) => link(s, t(s), state.screen === s ? "active" : "")).join("")}</nav>` : ""}</div><footer class="footnote">${t("synthetic")}</footer>`;
|
)}</select></label><label><select aria-label="Language" id="lang"><option value="en" ${state.lang === "en" ? "selected" : ""}>English</option><option value="nb" ${state.lang === "nb" ? "selected" : ""}>Norsk</option></select></label><button data-action="theme">${state.theme === "dark" ? "☀ Light" : "☾ Dark"}</button><button data-action="mobile">${state.phone ? t("desktop") : t("mobile")}</button></div><div class="shell"><header class="top"><a class="brand" href="#" data-screen="home"><span>${state.concept === "E" ? "↗" : "j"}</span>${c.name}</a><nav class="nav" aria-label="Primary">${nav.map((s) => link(s, t(s), state.screen === s ? "active" : "")).join("")}</nav><div class="actions">${link("mail", "✉ " + t("mail"))}${link("settings", t("settings"))}<span class="avatar">AO</span></div></header><main class="content" id="main">${(screens[state.screen] || home)()}<details style="margin-top:35px"><summary>${t("help")}</summary><div class="actions" style="margin-top:12px">${["cv", "letter", "mail", "settings", "admin", "onboarding"].map((s) => link(s, t(s))).join("")}</div></details></main>${state.concept === "E" ? `<nav class="journey-nav" aria-label="Journey">${["home", "discover", "applications", "profile", "calendar"].map((s) => link(s, t(s), state.screen === s ? "active" : "")).join("")}</nav>` : ""}</div><footer class="footnote">${t("synthetic")}</footer>`;
|
||||||
history.replaceState(
|
const search = `?concept=${state.concept}&screen=${state.screen}&lang=${state.lang}&theme=${state.theme}&job=${current.id}${state.phone ? "&mobile=1" : ""}`;
|
||||||
null,
|
if (search !== location.search) {
|
||||||
"",
|
if (navigating) history.pushState(null, "", search);
|
||||||
`?concept=${state.concept}&screen=${state.screen}&lang=${state.lang}&theme=${state.theme}&job=${current.id}${state.phone ? "&mobile=1" : ""}`,
|
else history.replaceState(null, "", search);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
window.addEventListener("popstate", () => {
|
||||||
|
Object.assign(state, routeFromLocation());
|
||||||
|
current = jobFromLocation();
|
||||||
|
render();
|
||||||
|
});
|
||||||
document.addEventListener("click", (event) => {
|
document.addEventListener("click", (event) => {
|
||||||
const a = event.target.closest("[data-screen]");
|
const a = event.target.closest("[data-screen]");
|
||||||
if (a) {
|
if (a) {
|
||||||
|
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (a.dataset.job)
|
if (a.dataset.job)
|
||||||
current = records.find((r) => r.id === a.dataset.job) || records[0];
|
current = records.find((r) => r.id === a.dataset.job) || records[0];
|
||||||
state.screen = a.dataset.screen;
|
state.screen = a.dataset.screen;
|
||||||
render();
|
render(true);
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -630,7 +645,7 @@ document.addEventListener("click", (event) => {
|
|||||||
if (screens.includes(action)) {
|
if (screens.includes(action)) {
|
||||||
if (state.screen === "home" && action === "detail") current = records[0];
|
if (state.screen === "home" && action === "detail") current = records[0];
|
||||||
state.screen = action;
|
state.screen = action;
|
||||||
render();
|
render(true);
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
} else if (action === "theme") {
|
} else if (action === "theme") {
|
||||||
state.theme = state.theme === "light" ? "dark" : "light";
|
state.theme = state.theme === "light" ? "dark" : "light";
|
||||||
@@ -659,7 +674,7 @@ document.addEventListener("click", (event) => {
|
|||||||
current.followup = true;
|
current.followup = true;
|
||||||
state.calendarView = "agenda";
|
state.calendarView = "agenda";
|
||||||
state.screen = "calendar";
|
state.screen = "calendar";
|
||||||
render();
|
render(true);
|
||||||
toast(
|
toast(
|
||||||
state.lang === "nb"
|
state.lang === "nb"
|
||||||
? "Oppfølging lagt til i prototypen"
|
? "Oppfølging lagt til i prototypen"
|
||||||
@@ -706,7 +721,7 @@ document.addEventListener("change", (e) => {
|
|||||||
}
|
}
|
||||||
if (["concept", "screen", "lang"].includes(e.target.id)) {
|
if (["concept", "screen", "lang"].includes(e.target.id)) {
|
||||||
state[e.target.id] = e.target.value;
|
state[e.target.id] = e.target.value;
|
||||||
render();
|
render(e.target.id !== "lang");
|
||||||
}
|
}
|
||||||
if (e.target.id === "settingLanguage") {
|
if (e.target.id === "settingLanguage") {
|
||||||
state.lang = e.target.value;
|
state.lang = e.target.value;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"width": 1440,
|
"width": 1440,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -12,6 +13,7 @@
|
|||||||
"width": 390,
|
"width": 390,
|
||||||
"lang": "nb",
|
"lang": "nb",
|
||||||
"theme": "dark",
|
"theme": "dark",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -19,6 +21,7 @@
|
|||||||
"width": 1440,
|
"width": 1440,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -26,6 +29,7 @@
|
|||||||
"width": 390,
|
"width": 390,
|
||||||
"lang": "nb",
|
"lang": "nb",
|
||||||
"theme": "dark",
|
"theme": "dark",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -33,6 +37,7 @@
|
|||||||
"width": 1440,
|
"width": 1440,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -40,6 +45,7 @@
|
|||||||
"width": 390,
|
"width": 390,
|
||||||
"lang": "nb",
|
"lang": "nb",
|
||||||
"theme": "dark",
|
"theme": "dark",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -47,6 +53,7 @@
|
|||||||
"width": 1440,
|
"width": 1440,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,6 +61,7 @@
|
|||||||
"width": 390,
|
"width": 390,
|
||||||
"lang": "nb",
|
"lang": "nb",
|
||||||
"theme": "dark",
|
"theme": "dark",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -61,6 +69,7 @@
|
|||||||
"width": 1440,
|
"width": 1440,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,6 +77,7 @@
|
|||||||
"width": 390,
|
"width": 390,
|
||||||
"lang": "nb",
|
"lang": "nb",
|
||||||
"theme": "dark",
|
"theme": "dark",
|
||||||
|
"historyRoundTrip": true,
|
||||||
"passed": true
|
"passed": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -111,8 +111,18 @@ async function verify() {
|
|||||||
await page.locator("#summary").inputValue(),
|
await page.locator("#summary").inputValue(),
|
||||||
"Field electrician CV.",
|
"Field electrician CV.",
|
||||||
);
|
);
|
||||||
|
await page.goBack();
|
||||||
|
assert.equal(new URL(page.url()).searchParams.get("screen"), "detail");
|
||||||
|
assert.equal(await page.locator("main h1").innerText(), "Front-of-house supervisor");
|
||||||
|
await page.goBack();
|
||||||
|
assert.equal(await page.locator("#country").inputValue(), "Denmark");
|
||||||
|
assert.equal(await page.locator("#search").inputValue(), "supervisor");
|
||||||
|
await page.goForward();
|
||||||
|
assert.equal(await page.locator("main h1").innerText(), "Front-of-house supervisor");
|
||||||
|
await page.goForward();
|
||||||
|
assert.match(await page.locator("main .heading").innerText(), /Harbour House/);
|
||||||
assert.deepEqual(errors, []);
|
assert.deepEqual(errors, []);
|
||||||
results.push({ concept, width, lang, theme, passed: true });
|
results.push({ concept, width, lang, theme, historyRoundTrip: true, passed: true });
|
||||||
await page.close();
|
await page.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user