Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ea7d8c77e | |||
| 6be8da1de7 | |||
| 29a5223c48 | |||
| a879fbcb0b | |||
| bdd13420c6 | |||
| 866b0dc1fb | |||
| 4e224151db |
@@ -12,8 +12,20 @@ namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class SavedJobSearchAlertTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Worker_establishes_baseline_then_notifies_only_for_later_results()
|
||||
[Theory]
|
||||
[InlineData("nb-NO", true)]
|
||||
[InlineData("nb", true)]
|
||||
[InlineData("no", true)]
|
||||
[InlineData(" NB-nO ", true)]
|
||||
[InlineData(" nB ", true)]
|
||||
[InlineData(" NO ", true)]
|
||||
[InlineData("en", false)]
|
||||
[InlineData(" EN ", false)]
|
||||
[InlineData(null, false)]
|
||||
[InlineData("", false)]
|
||||
[InlineData("sv-SE", false)]
|
||||
[InlineData("nn-NO", false)]
|
||||
public async Task Worker_uses_owner_language_for_later_results(string? language, bool norwegian)
|
||||
{
|
||||
var clock = new MutableTimeProvider(new DateTimeOffset(2026, 8, 31, 8, 0, 0, TimeSpan.Zero));
|
||||
var discovery = new FakeDiscovery(clock, "job-1");
|
||||
@@ -39,6 +51,9 @@ public sealed class SavedJobSearchAlertTests
|
||||
await using (var scope = provider.CreateAsyncScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<JobTrackerContext>();
|
||||
db.Users.AddRange(
|
||||
new ApplicationUser { Id = "owner-without-jobs", UiLanguage = language },
|
||||
new ApplicationUser { Id = "other-owner", UiLanguage = norwegian ? "en" : "nb-NO" });
|
||||
db.SavedJobSearches.Add(new SavedJobSearch
|
||||
{
|
||||
OwnerUserId = "owner-without-jobs",
|
||||
@@ -70,13 +85,43 @@ public sealed class SavedJobSearchAlertTests
|
||||
discovery.Ids.Add("job-2");
|
||||
Assert.Equal(new BackgroundWorkerRunResult(true, 1, 1, 0), await worker.RunOnceAsync(default));
|
||||
|
||||
await using var verification = provider.CreateAsyncScope();
|
||||
var notification = Assert.Single(await verification.ServiceProvider.GetRequiredService<JobTrackerContext>()
|
||||
.UserNotifications.IgnoreQueryFilters().AsNoTracking().ToListAsync());
|
||||
Assert.Equal("owner-without-jobs", notification.OwnerUserId);
|
||||
Assert.Equal("saved_search_results", notification.Kind);
|
||||
Assert.Equal("/discover", notification.LinkPath);
|
||||
Assert.Contains("Backend Oslo", notification.Message);
|
||||
await using (var verification = provider.CreateAsyncScope())
|
||||
{
|
||||
var notification = Assert.Single(await verification.ServiceProvider.GetRequiredService<JobTrackerContext>()
|
||||
.UserNotifications.IgnoreQueryFilters().AsNoTracking().ToListAsync());
|
||||
Assert.Equal("owner-without-jobs", notification.OwnerUserId);
|
||||
Assert.Equal("saved_search_results", notification.Kind);
|
||||
Assert.Equal("/discover", notification.LinkPath);
|
||||
Assert.Equal(norwegian ? "Ny stilling funnet" : "New vacancy found", notification.Title);
|
||||
Assert.Equal(norwegian
|
||||
? "Det lagrede søket «Backend Oslo» fant en ny stilling."
|
||||
: "Your saved search ‘Backend Oslo’ found a new vacancy.", notification.Message);
|
||||
}
|
||||
|
||||
discovery.Ids.AddRange(["job-3", "job-4"]);
|
||||
Assert.Equal(new BackgroundWorkerRunResult(true, 1, 1, 0), await worker.RunOnceAsync(default));
|
||||
await using (var verification = provider.CreateAsyncScope())
|
||||
Assert.Single(await verification.ServiceProvider.GetRequiredService<JobTrackerContext>()
|
||||
.UserNotifications.IgnoreQueryFilters().ToListAsync());
|
||||
|
||||
clock.SetUtcNow(clock.GetUtcNow().AddHours(7));
|
||||
Assert.Equal(new BackgroundWorkerRunResult(true, 1, 1, 0), await worker.RunOnceAsync(default));
|
||||
clock.SetUtcNow(clock.GetUtcNow().AddHours(7));
|
||||
Assert.Equal(new BackgroundWorkerRunResult(true, 1, 1, 0), await worker.RunOnceAsync(default));
|
||||
await using (var verification = provider.CreateAsyncScope())
|
||||
{
|
||||
var notifications = await verification.ServiceProvider.GetRequiredService<JobTrackerContext>()
|
||||
.UserNotifications.IgnoreQueryFilters().OrderBy(item => item.CreatedAtUtc).ToListAsync();
|
||||
Assert.Equal(2, notifications.Count);
|
||||
var notification = notifications[1];
|
||||
Assert.Equal("owner-without-jobs", notification.OwnerUserId);
|
||||
Assert.Equal("saved_search_results", notification.Kind);
|
||||
Assert.Equal("/discover", notification.LinkPath);
|
||||
Assert.Equal(norwegian ? "2 nye stillinger funnet" : "2 new vacancies found", notification.Title);
|
||||
Assert.Equal(norwegian
|
||||
? "Det lagrede søket «Backend Oslo» fant 2 nye stillinger."
|
||||
: "Your saved search ‘Backend Oslo’ found 2 new vacancies.", notification.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FakeDiscovery(MutableTimeProvider clock, params string[] ids) : IJobDiscoverySearchService
|
||||
|
||||
@@ -44,10 +44,9 @@ public sealed class SavedJobSearchAlertHostedService(
|
||||
var runner = services.GetRequiredService<SavedJobSearchRunner>();
|
||||
var now = timeProvider.GetUtcNow();
|
||||
var dueBefore = now - GetInterval();
|
||||
var useNorwegian = string.Equals(
|
||||
await db.Users.AsNoTracking().Where(user => user.Id == db.CurrentUserId).Select(user => user.UiLanguage).FirstOrDefaultAsync(cancellationToken),
|
||||
"nb",
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
var language = (await db.Users.AsNoTracking().Where(user => user.Id == db.CurrentUserId)
|
||||
.Select(user => user.UiLanguage).FirstOrDefaultAsync(cancellationToken))?.Trim();
|
||||
var useNorwegian = language?.ToLowerInvariant() is "nb" or "nb-no" or "no";
|
||||
var searches = await db.SavedJobSearches.Include(search => search.Results)
|
||||
.Where(search => search.IsActive)
|
||||
.OrderBy(search => search.Id)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Pending Admin confirmation language and users-read continuity
|
||||
|
||||
17 November 2026. Source `4e224151db2c8208f7511def72b957784eacbf73` on `codex/a3-ui-10`, based on `07fbd5f7` (now published/ref-verified after Git recovered).
|
||||
|
||||
Self/other-user demotion and account-deletion confirmations opt into the existing live translation metadata. Account names remain literal, escaped interpolation data. The users resource now has a language-independent fallback input; the Admin presenter resolves its empty fallback during rendering. This removes the locale-triggered users GET and translates pending/already-visible fallback failures while retaining entered form data and structured server messages/error flags. The shared resource hook is unchanged.
|
||||
|
||||
Preserved: session/mount guards, final-admin restrictions, explicit confirmations, current-user warning, exact account deletion header, role payloads, queued202 wording, create admission/draft handling, focus and pending decisions. No actual roles, accounts, MFA factors or server data were changed; all writes are mocked.
|
||||
|
||||
## Evidence
|
||||
|
||||
- Original16 stale-confirmation cases FAILED across desktop/mobile, EN/NB and self/other-user actions.
|
||||
- After copy migration, those16 reached the no-extra-read assertion and FAILED on the pre-existing language-triggered GET; intermediate24 pass/16 fail receipt retained. A requested nonexistent presentation test filename was not counted as a suite.
|
||||
- Four additional pending/already-visible read-failure/draft cases FAILED before the resource-input fix. This red run used the intermediate metadata source; the read dependency was unchanged from `07fbd5f7`.
|
||||
- Final44 cases/two actual suites PASSED (Admin34 plus shared contract10); earlier40/24 overlap. Non-incremental project TypeScript, two-file scoped lint and diff check PASSED.
|
||||
- Native outputs, deterministic gzip and source-at-commit hashes: `evidence/admin-dialog/SOURCE_RECEIPTS.json`. AST refresh is queued after the concurrent CV worker returns the test/source lane; do not claim it completed yet.
|
||||
|
||||
No build/browser/native-device, real administration, formal security, whole A3 or European-locale acceptance. The prior Next security build qualification remains open. Rollback: revert only this bounded source commit; no schema/data migration. Other Admin recovery/provider and protected factor-management decisions remain separate.
|
||||
|
||||
Follow-up: queued AST refresh completed19,305 nodes/47,429 edges alongside the CV reload/discard/restore package. Source/evidence were subsequently published/ref-verified through `a879fbcb`; the earlier queued wording describes the initial checkpoint only.
|
||||
@@ -0,0 +1,13 @@
|
||||
# CV reload, discard and history-restore dialog continuity
|
||||
|
||||
17 November 2026. Source `bdd13420c60cc624664baa96c1c003bc8ed5675e` on `codex/a3-ui-10`, following Admin source `4e224151`/evidence `866b0dc1`.
|
||||
|
||||
Conflict reload, dirty-navigation discard and history restore use existing live translation descriptors. The restore version remains a numeric interpolation parameter. No editor epoch, save queue/revision, autosave, document content, navigation blocker, server-version or mutation callback changed. Custom section/entry/built-in removal dialogs remain separate.
|
||||
|
||||
Six original EN/NB regressions FAILED on stale titles. Final corrected full deep-link suite84 cases PASSED, no skips/failures; focused6 overlaps84 and is not added. Tests retain the same pending dialog and draft/router state while switching, assert no extra read/write/restore on switch/cancel, and confirm one original-version restore with expectedVersion4 after explicit acceptance. Existing conflict/session/canonical/editor regressions also passed in that suite.
|
||||
|
||||
The worker caught a default-encoding rewrite of existing non-ASCII test literals. Its superseded full run59 pass/25 fail is preserved and excluded from qualification. Original literals were restored exactly; root reviewed final diff (test91 additions/no deletions; source seven descriptor replacements), independently matched raw hashes and parsed final native84/0/0 receipt. Non-incremental TypeScript, four-file scoped lint and diff check PASSED. Final source raw hashes match the worker handoff; native logs are retained exactly as gzip, with `.log` bytes copied under `.txt` names and origin recorded.
|
||||
|
||||
AST refresh after both packages PASSED19,305 nodes/47,429 edges. This also closes the queued Admin graph refresh; it is not a test execution or full application qualification. Evidence: `evidence/cv-editor-dialog/SOURCE_RECEIPTS.json`.
|
||||
|
||||
Real editor/router/providers with controlled API fixtures only; no actual CV import engine, model/provider, PDF rendering, native-device, full A3/I18N/security or release acceptance. Prior Next build remains FAILED pending advisory qualification. Rollback: revert this bounded source commit only; no data/schema migration. Formal European locale expansion remains separate from these EN/NB foundation fixes.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Custom CV entry confirmation language
|
||||
|
||||
17 November 2026. Source `29a5223c48e0c12119055569d5874d62518e7f99` on `codex/a3-ui-10`, after published `a879fbcb`.
|
||||
|
||||
Custom-entry deletion now uses the existing live descriptors for message/title/action. The entry filter, focus and save callbacks are byte-unchanged. Two EN/NB caller cases preserve both entries and read/write counts while pending; cancellation restores focus and content, and later acceptance removes the selected entry, focuses the survivor and saves once with expectedVersion4 and unchanged custom title/content.
|
||||
|
||||
Initial RED had a fixture error: the custom section omitted contentType entries. Corrected `red-confirmation` reproduced both stale-title failures against original source; initial native output retained as superseded. Final full editor suite86 PASSED/0 failed/0 skipped; focused2 and previous84 overlap86 and are not added. Root reviewed44 test additions/no deletions and one source-line replacement, matched exact raw file hashes and parsed native86/0/0. Non-incremental TypeScript, scoped lint, diff check and AST update PASSED19,307 nodes/47,430 edges.
|
||||
|
||||
Source/native gzip bindings: `evidence/cv-editor-entry-dialog/SOURCE_RECEIPTS.json`; original `.log` bytes retained under `.txt` with origin recorded. No live API/provider/model/import/physical PDF, native browser/device, full A3/I18N/security or release qualification. Prior Next build remains FAILED. Remaining section-removal dialogs include translated fallback parameters and need a separate compatible solution; literal titles must remain literal. Rollback: revert this source commit only; no data/schema migration.
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"sourceCommit": "4e224151db2c8208f7511def72b957784eacbf73",
|
||||
"sourcesLfSha256": {
|
||||
"job-tracker-ui/src/admin-users-page.test.tsx": "e797c18e87ff68155b8aa9d0077d8b8bfa3a64a830bda0dd2fee5ef07e1f48ec",
|
||||
"job-tracker-ui/src/views/AdminUsersPage.tsx": "cb50ca5bf5023511208365fc286f7bd03537e0707bb95113b8b37e6807fc113d"
|
||||
},
|
||||
"evidenceLfSha256": {
|
||||
"red.json": "603c45d9e1227679f98dc563ade446a7da42775ea2a8da0b233870eaaae7e65d",
|
||||
"red.txt": "cce640bfb939397f7ad919408d7c3a05ac273f75f8e728ae420ce9e110f21f15",
|
||||
"read-red.json": "29e0c4632d36b8fd81006ff3f14e8ff82760043a67de7dc49f4d938150619146",
|
||||
"read-red.txt": "44cc09260102d88db30901c6c85e14327ee9cd0560e7e3e46eec85718acf3397",
|
||||
"green.json": "891206904cb9a47585b2d6867da70635b3b6b66575fb327ac5bca30c82486464",
|
||||
"green.txt": "3b765b444e7c8d5a76bdc752cc04b97ba2b45ecbfa48be6079431b4413880e77",
|
||||
"final.json": "784bc7eb48ab02df12bbde413ba8f6bba93eb4e7b1209651ca43cbef696192cd",
|
||||
"final.txt": "9854fc95de67ca3e7583565412d32befc5fe2d53f8c6bcfbc807dc321755d723",
|
||||
"typecheck.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
"nativeReceipts": [
|
||||
{
|
||||
"path": "red.json",
|
||||
"gzipPath": "red.json.gz",
|
||||
"rawSha256": "603c45d9e1227679f98dc563ade446a7da42775ea2a8da0b233870eaaae7e65d",
|
||||
"gzipSha256": "ff9538bfa500414c9f710cd603717f2a79b66d1e9c600837ca941429002138d3"
|
||||
},
|
||||
{
|
||||
"path": "red.txt",
|
||||
"gzipPath": "red.txt.gz",
|
||||
"rawSha256": "2e4cc9e3885ddb6ca70b8abe4e5ec3e545bb9b3df65abaf212a5271f0c242d48",
|
||||
"gzipSha256": "63038bc7c56f848bfe5c34f7844ff50c6df3aa3e3946828c4b07fc49e6dfb89a"
|
||||
},
|
||||
{
|
||||
"path": "read-red.json",
|
||||
"gzipPath": "read-red.json.gz",
|
||||
"rawSha256": "29e0c4632d36b8fd81006ff3f14e8ff82760043a67de7dc49f4d938150619146",
|
||||
"gzipSha256": "3ed39341e5761750cf3c76f702a7f26bef725d2ea84ada19bb38385537aebd10"
|
||||
},
|
||||
{
|
||||
"path": "read-red.txt",
|
||||
"gzipPath": "read-red.txt.gz",
|
||||
"rawSha256": "6e9be1e2f3a9fe83241ae1e21fcd3739198c5fc0dfa436af57d8503b595ea1b6",
|
||||
"gzipSha256": "28c9da363fc4793fe7825e36c5842b2fc1abb8d447f4be39da5e184642dc871e"
|
||||
},
|
||||
{
|
||||
"path": "green.json",
|
||||
"gzipPath": "green.json.gz",
|
||||
"rawSha256": "891206904cb9a47585b2d6867da70635b3b6b66575fb327ac5bca30c82486464",
|
||||
"gzipSha256": "0b055c3e41c678b14c70b6c373a7391278abbb5aba1664c5fc24f72c54d0eb07"
|
||||
},
|
||||
{
|
||||
"path": "green.txt",
|
||||
"gzipPath": "green.txt.gz",
|
||||
"rawSha256": "b802e9422a6755c999e5b9034f72179d018b65bd259c6f0cead8373325e18d39",
|
||||
"gzipSha256": "89ec2a323ee9cc0c238a0bdc44d4ce9b6d535f28a5c99245923fb982ad207e38"
|
||||
},
|
||||
{
|
||||
"path": "final.json",
|
||||
"gzipPath": "final.json.gz",
|
||||
"rawSha256": "784bc7eb48ab02df12bbde413ba8f6bba93eb4e7b1209651ca43cbef696192cd",
|
||||
"gzipSha256": "cfdea9ed195babb4fe8bba128dd016ece3f5bff5cf2ee4116c77a09b5df98ddc"
|
||||
},
|
||||
{
|
||||
"path": "final.txt",
|
||||
"gzipPath": "final.txt.gz",
|
||||
"rawSha256": "3776ebbec5d698b4bb418228423bba4ba7ade81f5fe5bc8d7d3c4083cb52854f",
|
||||
"gzipSha256": "fd57cd303a9e6745ab8d3389a6c28161c5e2a81fe4de8fa814ef811b369aa33a"
|
||||
},
|
||||
{
|
||||
"path": "typecheck.txt",
|
||||
"gzipPath": "typecheck.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "lint.txt",
|
||||
"gzipPath": "lint.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
|
||||
Test Suites: 2 passed, 2 total
|
||||
Tests: 44 passed, 44 total
|
||||
Snapshots: 0 total
|
||||
Time: 21.839 s
|
||||
Ran all test suites matching src/admin-users-page.test.tsx|src/dialog-text.test.tsx.
|
||||
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\admin-dialog-final.json
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,311 @@
|
||||
FAIL src/admin-users-page.test.tsx (13.331 s)
|
||||
● Console
|
||||
|
||||
console.error
|
||||
An update to AdminUsersPage inside a test was not wrapped in act(...).
|
||||
|
||||
When testing, code that causes React state updates should be wrapped into act(...):
|
||||
|
||||
act(() => {
|
||||
/* fire events that update state */
|
||||
});
|
||||
/* assert on the output */
|
||||
|
||||
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
|
||||
|
||||
146 | return () => { checkSessionCookie(); return lifetime.mounted && lifetime.generation===generation && !isSessionInvalidated() && getSessionContext()===context; };
|
||||
147 | }, []);
|
||||
> 148 | const finishAction=useCallback((active: () => boolean) => { owner.current.busy=false; if (active()) setBusy(false); }, []);
|
||||
| ^
|
||||
149 |
|
||||
150 | const createUser=async () => {
|
||||
151 | if (!canCreate) return;
|
||||
|
||||
at node_modules/react-dom/cjs/react-dom-client.development.js:18758:19
|
||||
at runWithFiberInDEV (node_modules/react-dom/cjs/react-dom-client.development.js:874:13)
|
||||
at warnIfUpdatesNotWrappedWithActDEV (node_modules/react-dom/cjs/react-dom-client.development.js:18757:9)
|
||||
at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom-client.development.js:16409:11)
|
||||
at dispatchSetStateInternal (node_modules/react-dom/cjs/react-dom-client.development.js:9170:13)
|
||||
at dispatchSetState (node_modules/react-dom/cjs/react-dom-client.development.js:9127:7)
|
||||
at setBusy (src/views/AdminUsersPage.tsx:148:103)
|
||||
at finishAction (src/views/AdminUsersPage.tsx:203:15)
|
||||
|
||||
● pending admin confirmation mobile=true demote self follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true demote self follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true demote other follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true demote other follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true delete self follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true delete self follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true delete other follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=true delete other follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false demote self follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false demote self follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false demote other follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false demote other follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false delete self follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false delete self follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false delete other follows en to nb without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
● pending admin confirmation mobile=false delete other follows nb to en without applying it
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
84 | expect(cancel).toHaveFocus();
|
||||
> 85 | expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
| ^
|
||||
86 | expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
87 | fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
88 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:85:25)
|
||||
|
||||
|
||||
Test Suites: 1 failed, 1 passed, 2 total
|
||||
Tests: 16 failed, 24 passed, 40 total
|
||||
Snapshots: 0 total
|
||||
Time: 17.186 s
|
||||
Ran all test suites matching src/admin-users-page.test.tsx|src/dialog-text.test.tsx|src/account-admin-presentation.test.tsx.
|
||||
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\admin-dialog-green.json
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,75 @@
|
||||
FAIL src/admin-users-page.test.tsx
|
||||
● users en to nb keeps pending read failure and draft without another request
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
73 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
74 | if (state === 'pending') await act(async () => reject(new Error('synthetic unavailable users')));
|
||||
> 75 | expect(mockedApi.get).toHaveBeenCalledTimes(1);
|
||||
| ^
|
||||
76 | expect(await screen.findByRole('button', { name: translations[to].retry })).toBeVisible();
|
||||
77 | expect(screen.getAllByText(translations[to].adminUsersLoadFailed).length).toBeGreaterThan(0);
|
||||
78 | expect(screen.queryByText(translations[from].adminUsersLoadFailed)).not.toBeInTheDocument();
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:75:25)
|
||||
|
||||
● users en to nb keeps visible read failure and draft without another request
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
73 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
74 | if (state === 'pending') await act(async () => reject(new Error('synthetic unavailable users')));
|
||||
> 75 | expect(mockedApi.get).toHaveBeenCalledTimes(1);
|
||||
| ^
|
||||
76 | expect(await screen.findByRole('button', { name: translations[to].retry })).toBeVisible();
|
||||
77 | expect(screen.getAllByText(translations[to].adminUsersLoadFailed).length).toBeGreaterThan(0);
|
||||
78 | expect(screen.queryByText(translations[from].adminUsersLoadFailed)).not.toBeInTheDocument();
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:75:25)
|
||||
|
||||
● users nb to en keeps pending read failure and draft without another request
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
73 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
74 | if (state === 'pending') await act(async () => reject(new Error('synthetic unavailable users')));
|
||||
> 75 | expect(mockedApi.get).toHaveBeenCalledTimes(1);
|
||||
| ^
|
||||
76 | expect(await screen.findByRole('button', { name: translations[to].retry })).toBeVisible();
|
||||
77 | expect(screen.getAllByText(translations[to].adminUsersLoadFailed).length).toBeGreaterThan(0);
|
||||
78 | expect(screen.queryByText(translations[from].adminUsersLoadFailed)).not.toBeInTheDocument();
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:75:25)
|
||||
|
||||
● users nb to en keeps visible read failure and draft without another request
|
||||
|
||||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||||
|
||||
Expected number of calls: 1
|
||||
Received number of calls: 2
|
||||
|
||||
73 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
74 | if (state === 'pending') await act(async () => reject(new Error('synthetic unavailable users')));
|
||||
> 75 | expect(mockedApi.get).toHaveBeenCalledTimes(1);
|
||||
| ^
|
||||
76 | expect(await screen.findByRole('button', { name: translations[to].retry })).toBeVisible();
|
||||
77 | expect(screen.getAllByText(translations[to].adminUsersLoadFailed).length).toBeGreaterThan(0);
|
||||
78 | expect(screen.queryByText(translations[from].adminUsersLoadFailed)).not.toBeInTheDocument();
|
||||
|
||||
at toHaveBeenCalledTimes (src/admin-users-page.test.tsx:75:25)
|
||||
|
||||
Test Suites: 1 failed, 1 total
|
||||
Tests: 4 failed, 30 skipped, 34 total
|
||||
Snapshots: 0 total
|
||||
Time: 4.972 s
|
||||
Ran all test suites matching src/admin-users-page.test.tsx with tests matching "read failure and draft".
|
||||
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\admin-dialog-read-red.json
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"sourceCommit": "bdd13420c60cc624664baa96c1c003bc8ed5675e",
|
||||
"sourcesLfSha256": {
|
||||
"job-tracker-ui/src/views/CvBuilderEditor.tsx": "20467605165db21a0d55357e24fbefbd831fe82b7040656a7f6be1a1cf59627e",
|
||||
"job-tracker-ui/src/cv-builder-deep-link.test.tsx": "9e1e2aab6b0401d22416ee1063af7ef8cdca1c1e9f619ee1273ddf78d58614b0"
|
||||
},
|
||||
"evidenceLfSha256": {
|
||||
"red.json": "8ec3354b0d6ce7b0dfd73d9dad6500b800427d3c8a0170c7767479d78ac9ec00",
|
||||
"red.txt": "8d3b882d88a2b538a503621c0faea21019ea03b281417812b71e683ed8818162",
|
||||
"green-focused.json": "2c4e7f36cfdd6c9fb8f3f1c07e04003e5866331d016a0093bd05a6c89d4cb44a",
|
||||
"green-focused.txt": "a77e476122eec6cf939ea8a20af929934bd5936ff3ef9bcf187dfe3ade4d1e45",
|
||||
"green-full.json": "4970602efa51a791aa5892cfeee5019cb95966b0ed69a122f3e0092f2627c707",
|
||||
"green-full.txt": "e63d8942fa83dcce73743ee72ae8a2dfe2f187ada79d5ad48b28a6d08f48f27b",
|
||||
"green-final.json": "eef3b5508b43692ebf642cb9d1ea12789da22267c733f812ccda3505dde4d18b",
|
||||
"green-final.txt": "252c734f1bf32c0c4e5711bc0832098be23724f1dbf0b1b7fa3b0d538dea60f5",
|
||||
"final-summary.json": "6ac95ac638ce8e969148fac214e019fb1f0664489f132367ab5df5c0b5d6ad9f",
|
||||
"typecheck.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"graph.txt": "8ff40497a2a0cddd803e61b125c8f048600ac414e00c4f837d967db2caa05da4"
|
||||
},
|
||||
"nativeReceipts": [
|
||||
{
|
||||
"path": "red.json",
|
||||
"originFile": "red.json",
|
||||
"gzipPath": "red.json.gz",
|
||||
"rawSha256": "8ec3354b0d6ce7b0dfd73d9dad6500b800427d3c8a0170c7767479d78ac9ec00",
|
||||
"gzipSha256": "fd7a8889218e25939ae74d08da6c00be62dc6b41175bd954b78bab6098ed0310"
|
||||
},
|
||||
{
|
||||
"path": "red.txt",
|
||||
"originFile": "red.log",
|
||||
"gzipPath": "red.txt.gz",
|
||||
"rawSha256": "8d3b882d88a2b538a503621c0faea21019ea03b281417812b71e683ed8818162",
|
||||
"gzipSha256": "6d282139c36f0cd50933f814c292416d68e7292ab77615eb6fbc9f2043ee32f8"
|
||||
},
|
||||
{
|
||||
"path": "green-focused.json",
|
||||
"originFile": "green-focused.json",
|
||||
"gzipPath": "green-focused.json.gz",
|
||||
"rawSha256": "2c4e7f36cfdd6c9fb8f3f1c07e04003e5866331d016a0093bd05a6c89d4cb44a",
|
||||
"gzipSha256": "29de775121ab3f59ffdd9cf56d929c53df636bdacbd262a875c8995a5dc11e4f"
|
||||
},
|
||||
{
|
||||
"path": "green-focused.txt",
|
||||
"originFile": "green-focused.log",
|
||||
"gzipPath": "green-focused.txt.gz",
|
||||
"rawSha256": "a77e476122eec6cf939ea8a20af929934bd5936ff3ef9bcf187dfe3ade4d1e45",
|
||||
"gzipSha256": "2805b5e4041f6d0104500df130f4939a7bf1ce6589bb2fb7e74524f28d0ef1f8"
|
||||
},
|
||||
{
|
||||
"path": "green-full.json",
|
||||
"originFile": "green-full.json",
|
||||
"gzipPath": "green-full.json.gz",
|
||||
"rawSha256": "4970602efa51a791aa5892cfeee5019cb95966b0ed69a122f3e0092f2627c707",
|
||||
"gzipSha256": "86b6e93175e76c04486a2f8d2d9acac992508461b23f34f754db1cb86c32bfb3"
|
||||
},
|
||||
{
|
||||
"path": "green-full.txt",
|
||||
"originFile": "green-full.log",
|
||||
"gzipPath": "green-full.txt.gz",
|
||||
"rawSha256": "e63d8942fa83dcce73743ee72ae8a2dfe2f187ada79d5ad48b28a6d08f48f27b",
|
||||
"gzipSha256": "c63f004d6b0eb48a0a9846a10a2c72d8d03191b77b24af467827f8bc5ba92445"
|
||||
},
|
||||
{
|
||||
"path": "green-final.json",
|
||||
"originFile": "green-final.json",
|
||||
"gzipPath": "green-final.json.gz",
|
||||
"rawSha256": "eef3b5508b43692ebf642cb9d1ea12789da22267c733f812ccda3505dde4d18b",
|
||||
"gzipSha256": "b41f3167f7539b02dd995a65ad5ba7d1254f3fdc24e6126848b729fdc629599a"
|
||||
},
|
||||
{
|
||||
"path": "green-final.txt",
|
||||
"originFile": "green-final.log",
|
||||
"gzipPath": "green-final.txt.gz",
|
||||
"rawSha256": "252c734f1bf32c0c4e5711bc0832098be23724f1dbf0b1b7fa3b0d538dea60f5",
|
||||
"gzipSha256": "23bd34eb5b4b9fbc231b8d77fa14f2e20637ce02b7b1775e9365f5c52b9d2ba9"
|
||||
},
|
||||
{
|
||||
"path": "final-summary.json",
|
||||
"originFile": "final-summary.json",
|
||||
"gzipPath": "final-summary.json.gz",
|
||||
"rawSha256": "472410ac671d7f3eada81082517eaa93f0c8352a07f8ad0cdb23c6537bdeeee9",
|
||||
"gzipSha256": "883a1596b96fe0d449b9c0003464500456ff2058866424f0d5773356abc4bb09"
|
||||
},
|
||||
{
|
||||
"path": "typecheck.txt",
|
||||
"originFile": "typecheck.txt",
|
||||
"gzipPath": "typecheck.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "lint.txt",
|
||||
"originFile": "lint.txt",
|
||||
"gzipPath": "lint.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "graph.txt",
|
||||
"originFile": "graph.txt",
|
||||
"gzipPath": "graph.txt.gz",
|
||||
"rawSha256": "419cda751b3de7c66ab0f11037fe92a523cf60c0a93417530a5afbae9d5cf438",
|
||||
"gzipSha256": "80d4cbe6945987f80f9ee9266f5ae595c07f0089e39263e4c0b81ad24c327c21"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"numFailedTests": 0,
|
||||
"numPassedTests": 84,
|
||||
"numPendingTests": 0,
|
||||
"numTotalTests": 84,
|
||||
"numPassedTestSuites": 1,
|
||||
"success": true,
|
||||
"files": {
|
||||
"job-tracker-ui/src/views/CvBuilderEditor.tsx": "34182bb72810c9951ac27a56d44b5672418efdda2ab741d6eea24969d7934fc2",
|
||||
"job-tracker-ui/src/cv-builder-deep-link.test.tsx": "baffbb20a34f62b746c5bb9f098dfae0e8de5a9c62206d311f96031600c49590"
|
||||
},
|
||||
"superseded": [
|
||||
"green-full.log",
|
||||
"green-full.json",
|
||||
"green-focused.log",
|
||||
"green-focused.json"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
Re-extracting code files in . (no LLM needed)...
|
||||
[graphify watch] 665 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, 1440-en-dark-converted.gz (+659 more)
|
||||
AST cache: 2581/3036 files served from cache (85%); 455 to extract
|
||||
AST extraction: 100/455 uncached files (21%) [16 workers]
|
||||
AST extraction: 200/455 uncached files (43%) [16 workers]
|
||||
AST extraction: 300/455 uncached files (65%) [16 workers]
|
||||
AST extraction: 400/455 uncached files (87%) [16 workers]
|
||||
AST extraction: 455/455 uncached files (100%) [16 workers]
|
||||
warning: 8 .sql file(s) contributed nothing to the graph because a dependency is missing: tree_sitter_sql not installed. Install it with: pip install "graphifyy[sql]" (#1745)
|
||||
warning: 144 code file(s) yielded no symbols (0.14 MB) — a data file, or source this extractor models no symbols for: JobTrackerApi.Tests/PdfBrowserStub/Program.cs, JobTrackerApi/Program.cs, JobTrackerApi/Properties/AssemblyInfo.cs, browser-extension/tests/capture-url.test.mjs, docs/audits/2026-09-07/validation/evidence/b05-excel-probe.ps1 (+139 more)
|
||||
[graphify watch] community set changed since labeling (0 saved labels, 1206 communities now; renamed 118 community(ies) by their hub). Run `graphify label` to refresh names with the LLM.
|
||||
Graph has 19305 nodes (above 5000 limit). Building aggregated community view...
|
||||
graph.html written (aggregated: 1206 community nodes, 3121 cross-community edges)
|
||||
Tip: run with --obsidian for full node-level detail.
|
||||
[graphify watch] Rebuilt: 19305 nodes, 47429 edges, 1206 communities
|
||||
[graphify watch] graph.json, graph.html and GRAPH_REPORT.md updated in graphify-out
|
||||
Code graph updated. For doc/paper/image changes run /graphify --update in your AI assistant.
|
||||
Tip: set GEMINI_API_KEY or GOOGLE_API_KEY to use Gemini for semantic extraction.
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"sourceCommit": "29a5223c48e0c12119055569d5874d62518e7f99",
|
||||
"sourcesLfSha256": {
|
||||
"job-tracker-ui/src/views/CvBuilderEditor.tsx": "cd618cbb0c41db1e4b0f91191bd725dd9ccef1121cac8866231bcb3658c68eb0",
|
||||
"job-tracker-ui/src/cv-builder-deep-link.test.tsx": "e78fa4273cc659bd19deee85af160b260d2222362420658aa6b379dc3d581922"
|
||||
},
|
||||
"evidenceLfSha256": {
|
||||
"red.json": "d9d842d482c438a120dcb192d75a497efae207de3afd14f80950a194567b7ec9",
|
||||
"red.txt": "cb3f0e078449489a3ef8e5536df524d0277eefc3e7ed90f1f106cba38a54151d",
|
||||
"green-focused.json": "407e7ed5cc028789d761a416d9abb619b72160ad5584554cc69a8d4efb69c238",
|
||||
"green-focused.txt": "edbe47b7e89645e4b951eeb28182e0df31f2cfdf5f28031c953c53c23989b642",
|
||||
"red-confirmation.json": "c976f40214783aa83916166a8ae743d90bdde6a49fbea2f3101cd2567107b5dd",
|
||||
"red-confirmation.txt": "62700e4e4b2cc831ccbfc78b7fcba707ed07f15c5b7b1603ce934639b08d7f48",
|
||||
"green-final.json": "819ece333e0daca936f8fa287a95540404973eba842c9f514826f3dfbb9e939f",
|
||||
"green-final.txt": "ded5df2cdbc9f7159f19056e74f6667c580c90a933921379de220d5f34f70629",
|
||||
"final-summary.json": "d0513e0d247bc8db13b73ca5b9a98f54b4d3b17bdda26ea0284bc8c1c6cd2b2b",
|
||||
"typecheck.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"graph.txt": "07b146af586e44a5b720c8bf182f434b6d1cf39d6c86c289531465da5c8073de"
|
||||
},
|
||||
"nativeReceipts": [
|
||||
{
|
||||
"path": "red.json",
|
||||
"originFile": "red.json",
|
||||
"gzipPath": "red.json.gz",
|
||||
"rawSha256": "d9d842d482c438a120dcb192d75a497efae207de3afd14f80950a194567b7ec9",
|
||||
"gzipSha256": "8584a3ea2cb5c3b7cdbfbc2715bc362a1b0f9dc2197fe0b3dfe7a37f7288bb5b"
|
||||
},
|
||||
{
|
||||
"path": "red.txt",
|
||||
"originFile": "red.log",
|
||||
"gzipPath": "red.txt.gz",
|
||||
"rawSha256": "cb3f0e078449489a3ef8e5536df524d0277eefc3e7ed90f1f106cba38a54151d",
|
||||
"gzipSha256": "2b516ba2bd41db6e520d5b4ea5194ac380978e4412822b8fd84f71c6c056cd98"
|
||||
},
|
||||
{
|
||||
"path": "green-focused.json",
|
||||
"originFile": "green-focused.json",
|
||||
"gzipPath": "green-focused.json.gz",
|
||||
"rawSha256": "407e7ed5cc028789d761a416d9abb619b72160ad5584554cc69a8d4efb69c238",
|
||||
"gzipSha256": "80cf9c70b7849e21d9c07ba844c66cc05bbf8299e133b67411c10bbad91c0568"
|
||||
},
|
||||
{
|
||||
"path": "green-focused.txt",
|
||||
"originFile": "green-focused.log",
|
||||
"gzipPath": "green-focused.txt.gz",
|
||||
"rawSha256": "edbe47b7e89645e4b951eeb28182e0df31f2cfdf5f28031c953c53c23989b642",
|
||||
"gzipSha256": "b00d7f3bafb5b66ba0a1fef0f110840df6857f15f71789f8b8ebd2fd56f868ee"
|
||||
},
|
||||
{
|
||||
"path": "red-confirmation.json",
|
||||
"originFile": "red-confirmation.json",
|
||||
"gzipPath": "red-confirmation.json.gz",
|
||||
"rawSha256": "c976f40214783aa83916166a8ae743d90bdde6a49fbea2f3101cd2567107b5dd",
|
||||
"gzipSha256": "6acfd4901d213aed08cedbbd3ca71da51f4f71dc4d80a51984fc95241d89e1a1"
|
||||
},
|
||||
{
|
||||
"path": "red-confirmation.txt",
|
||||
"originFile": "red-confirmation.log",
|
||||
"gzipPath": "red-confirmation.txt.gz",
|
||||
"rawSha256": "62700e4e4b2cc831ccbfc78b7fcba707ed07f15c5b7b1603ce934639b08d7f48",
|
||||
"gzipSha256": "8b55204023fbe7b4c3a119e0754f31047034d139069f8ef3c281f991c759ec42"
|
||||
},
|
||||
{
|
||||
"path": "green-final.json",
|
||||
"originFile": "green-final.json",
|
||||
"gzipPath": "green-final.json.gz",
|
||||
"rawSha256": "819ece333e0daca936f8fa287a95540404973eba842c9f514826f3dfbb9e939f",
|
||||
"gzipSha256": "9bd1d72715bd1654e56c7bd417f683a1ad0b5225aee40b2f9ae4ed8ea4b06a9a"
|
||||
},
|
||||
{
|
||||
"path": "green-final.txt",
|
||||
"originFile": "green-final.log",
|
||||
"gzipPath": "green-final.txt.gz",
|
||||
"rawSha256": "ded5df2cdbc9f7159f19056e74f6667c580c90a933921379de220d5f34f70629",
|
||||
"gzipSha256": "a641495b000c376e4be69715a5d0a806789bf95371ff9795f2b632d37df51f64"
|
||||
},
|
||||
{
|
||||
"path": "final-summary.json",
|
||||
"originFile": "final-summary.json",
|
||||
"gzipPath": "final-summary.json.gz",
|
||||
"rawSha256": "cd873a1b64374683c4f499eb136a1c3ea13f03bae2f91aec78cd5b6ae242b001",
|
||||
"gzipSha256": "6f9f931f7470c57eae0ccc531a450d8681e97c00fd8876c287493140220a3139"
|
||||
},
|
||||
{
|
||||
"path": "typecheck.txt",
|
||||
"originFile": "typecheck.txt",
|
||||
"gzipPath": "typecheck.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "lint.txt",
|
||||
"originFile": "lint.txt",
|
||||
"gzipPath": "lint.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
|
||||
},
|
||||
{
|
||||
"path": "graph.txt",
|
||||
"originFile": "graph.txt",
|
||||
"gzipPath": "graph.txt.gz",
|
||||
"rawSha256": "349f368c86cbddc63926ca72e4a4f2fd3bbcca37e2245ec180578cecc475792a",
|
||||
"gzipSha256": "4c8ef2cf43952efab405c19c18a209569dfba80a2cc1e95a3c44dca94db7aab7"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"numFailedTests": 0,
|
||||
"numPassedTests": 86,
|
||||
"numPendingTests": 0,
|
||||
"numTotalTests": 86,
|
||||
"numPassedTestSuites": 1,
|
||||
"success": true,
|
||||
"files": {
|
||||
"job-tracker-ui/src/views/CvBuilderEditor.tsx": "0bb3f7408fde200ab1a7a8d93551d3f0091108b6e28d52d1afefb588df7ee147",
|
||||
"job-tracker-ui/src/cv-builder-deep-link.test.tsx": "3dba7cff3e838942bfb805442c2e1abbfb6f18f54e6ef498832acd1265b09501"
|
||||
},
|
||||
"supersededFixtureRun": [
|
||||
"red.log",
|
||||
"red.json"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
Re-extracting code files in . (no LLM needed)...
|
||||
[graphify watch] 677 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, 1440-en-dark-converted.gz (+671 more)
|
||||
AST cache: 2592/3043 files served from cache (85%); 451 to extract
|
||||
AST extraction: 100/451 uncached files (22%) [16 workers]
|
||||
AST extraction: 200/451 uncached files (44%) [16 workers]
|
||||
AST extraction: 300/451 uncached files (66%) [16 workers]
|
||||
AST extraction: 400/451 uncached files (88%) [16 workers]
|
||||
AST extraction: 451/451 uncached files (100%) [16 workers]
|
||||
warning: 8 .sql file(s) contributed nothing to the graph because a dependency is missing: tree_sitter_sql not installed. Install it with: pip install "graphifyy[sql]" (#1745)
|
||||
warning: 144 code file(s) yielded no symbols (0.14 MB) — a data file, or source this extractor models no symbols for: JobTrackerApi.Tests/PdfBrowserStub/Program.cs, JobTrackerApi/Program.cs, JobTrackerApi/Properties/AssemblyInfo.cs, browser-extension/tests/capture-url.test.mjs, docs/audits/2026-09-07/validation/evidence/b05-excel-probe.ps1 (+139 more)
|
||||
[graphify watch] community set changed since labeling (0 saved labels, 1190 communities now; renamed 130 community(ies) by their hub). Run `graphify label` to refresh names with the LLM.
|
||||
Graph has 19307 nodes (above 5000 limit). Building aggregated community view...
|
||||
graph.html written (aggregated: 1190 community nodes, 3120 cross-community edges)
|
||||
Tip: run with --obsidian for full node-level detail.
|
||||
[graphify watch] Rebuilt: 19307 nodes, 47430 edges, 1190 communities
|
||||
[graphify watch] graph.json, graph.html and GRAPH_REPORT.md updated in graphify-out
|
||||
Code graph updated. For doc/paper/image changes run /graphify --update in your AI assistant.
|
||||
Tip: set GEMINI_API_KEY or GOOGLE_API_KEY to use Gemini for semantic extraction.
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,7 @@ import { PromptProvider } from "./prompt";
|
||||
import { getTheme } from "./theme";
|
||||
import { ToastProvider } from "./toast";
|
||||
import AdminUsersPage from "./views/AdminUsersPage";
|
||||
import { translations } from "./i18n/translations";
|
||||
|
||||
jest.mock("./api", () => ({
|
||||
api: { get: jest.fn(), put: jest.fn(), post: jest.fn(), delete: jest.fn() },
|
||||
@@ -60,6 +61,53 @@ async function openUserActions() {
|
||||
return screen.findByRole("menu");
|
||||
}
|
||||
|
||||
test.each((['en', 'nb'] as const).flatMap(from => (['pending', 'visible'] as const).map(state => [from, from === 'en' ? 'nb' : 'en', state] as const)))('users %s to %s keeps %s read failure and draft without another request', async (from, to, state) => {
|
||||
localStorage.setItem('uiLanguage', from);
|
||||
let reject!: (error: unknown) => void;
|
||||
const pending = new Promise((_resolve, no) => { reject = no; });
|
||||
if (state === 'pending') mockedApi.get.mockReturnValueOnce(pending as any);
|
||||
else mockedApi.get.mockRejectedValueOnce(new Error('synthetic unavailable users'));
|
||||
renderPage([]);
|
||||
fireEvent.change(screen.getByLabelText(translations[from].profileEmail), { target: { value: 'draft@example.test' } });
|
||||
if (state === 'visible') await screen.findByRole('button', { name: translations[from].retry });
|
||||
await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
if (state === 'pending') await act(async () => reject(new Error('synthetic unavailable users')));
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(1);
|
||||
expect(await screen.findByRole('button', { name: translations[to].retry })).toBeVisible();
|
||||
expect(screen.getAllByText(translations[to].adminUsersLoadFailed).length).toBeGreaterThan(0);
|
||||
expect(screen.queryByText(translations[from].adminUsersLoadFailed)).not.toBeInTheDocument();
|
||||
expect(screen.getByLabelText(translations[to].profileEmail)).toHaveValue('draft@example.test');
|
||||
expect(mockedApi.post).not.toHaveBeenCalled(); expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(([true, false] as const).flatMap(mobile => (['demote self', 'demote other', 'delete self', 'delete other'] as const).flatMap(action => (['en', 'nb'] as const).map(from => [mobile, action, from, from === 'en' ? 'nb' : 'en'] as const))))('pending admin confirmation mobile=%s %s follows %s to %s without applying it', async (mobile, action, from, to) => {
|
||||
localStorage.setItem('uiLanguage', from);
|
||||
(window.matchMedia as jest.Mock).mockImplementation(() => ({ matches: mobile, addEventListener: jest.fn(), removeEventListener: jest.fn(), addListener: jest.fn(), removeListener: jest.fn() }));
|
||||
const isCurrentUser = action.endsWith('self');
|
||||
const demote = action.startsWith('demote');
|
||||
const name = 'Søker 東京 <review>';
|
||||
renderPage([{ id: 'selected-user', email: 'selected@example.test', userName: name, roles: demote ? ['Admin'] : [], emailConfirmed: true, isCurrentUser, canRemoveAdmin: true }]);
|
||||
fireEvent.click(await screen.findByRole('button', { name: translations[from].adminUsersActionsFor.replace('{name}', 'selected@example.test') }));
|
||||
fireEvent.click(within(await screen.findByRole('menu')).getByRole('menuitem', { name: translations[from][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] }));
|
||||
const titleKey = demote ? isCurrentUser ? 'adminUsersSelfDemoteTitle' : 'adminUsersDemoteTitle' : 'adminUsersDeleteConfirmTitle';
|
||||
const messageKey = demote ? isCurrentUser ? 'adminUsersSelfDemoteWarning' : 'adminUsersDemoteWarning' : isCurrentUser ? 'adminUsersDeleteSelfWarning' : 'adminUsersDeleteConfirmNamed';
|
||||
const opened = await screen.findByRole('dialog', { name: translations[from][titleKey] });
|
||||
const cancel = within(opened).getByRole('button', { name: translations[from].cancel });
|
||||
act(() => cancel.focus());
|
||||
const reads = mockedApi.get.mock.calls.length;
|
||||
await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
||||
expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
||||
expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
||||
expect(opened.querySelector('review')).toBeNull();
|
||||
expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
||||
expect(cancel).toHaveFocus();
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
fireEvent.click(within(opened).getByRole('button', { name: translations[to].cancel }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(mockedApi.put).not.toHaveBeenCalled(); expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each([['en', 'Rows per page:'], ['nb', 'Rader per side:']])('desktop user-grid pagination follows %s UI language', async (language, label) => {
|
||||
window.localStorage.setItem('uiLanguage', language);
|
||||
(window.matchMedia as jest.Mock).mockImplementation(() => ({ matches: false, addEventListener: jest.fn(), removeEventListener: jest.fn(), addListener: jest.fn(), removeListener: jest.fn() }));
|
||||
|
||||
@@ -91,6 +91,141 @@ function SwitchCountLanguage() {
|
||||
return <button onClick={() => setLocalLanguage(language === 'en' ? 'nb' : 'en')}>Switch count language</button>;
|
||||
}
|
||||
|
||||
test.each(['en', 'nb'] as const)('pending CV reload follows %s language changes without resolving the decision', async (language) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const next = language === 'en' ? 'nb' : 'en';
|
||||
routeGet(() => Promise.resolve({ data: variant }));
|
||||
mockedApi.put.mockRejectedValue({ response: { status: 409, data: { code: 'cv_revision_conflict' } } });
|
||||
renderAt(3, false, <SwitchCountLanguage />);
|
||||
await screen.findByDisplayValue('Backend CV');
|
||||
fireEvent.click(screen.getByRole('tab', { name: translations[language].cvEditorContent }));
|
||||
const headline = screen.getByLabelText(translations[language].cvEditorHeadlineOverride);
|
||||
fireEvent.change(headline, { target: { value: 'Recoverable pending draft' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[language].cvEditorSaveNow }));
|
||||
await screen.findByText(translations[language].cvEditorConflict);
|
||||
const reads = mockedApi.get.mock.calls.length;
|
||||
const writes = mockedApi.put.mock.calls.length;
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[language].cvEditorConflictReload }));
|
||||
const dialog = await screen.findByRole('dialog', { name: translations[language].cvEditorConflictReload });
|
||||
fireEvent.click(screen.getByText('Switch count language'));
|
||||
expect(screen.getByRole('dialog', { name: translations[next].cvEditorConflictReload })).toBe(dialog);
|
||||
expect(within(dialog).getByText(translations[next].cvEditorConflictReloadMessage)).toBeInTheDocument();
|
||||
expect(within(dialog).getByText(translations[next].confirmDestructiveHint)).toBeInTheDocument();
|
||||
expect(within(dialog).getByRole('button', { name: translations[next].cvEditorConflictReload })).toBeInTheDocument();
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
expect(mockedApi.put).toHaveBeenCalledTimes(writes);
|
||||
expect(headline).toHaveValue('Recoverable pending draft');
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: translations[next].cancel }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(headline).toHaveValue('Recoverable pending draft');
|
||||
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('pending CV discard follows %s language changes and preserves the blocked draft', async (language) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const next = language === 'en' ? 'nb' : 'en';
|
||||
routeGet(() => Promise.resolve({ data: variant }));
|
||||
mockedApi.put.mockRejectedValue({ response: { status: 409, data: { code: 'cv_revision_conflict' } } });
|
||||
const { router } = renderAt(3, false, <SwitchCountLanguage />);
|
||||
await screen.findByDisplayValue('Backend CV');
|
||||
fireEvent.click(screen.getByRole('tab', { name: translations[language].cvEditorContent }));
|
||||
const headline = screen.getByLabelText(translations[language].cvEditorHeadlineOverride);
|
||||
fireEvent.change(headline, { target: { value: 'Blocked draft' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[language].cvEditorSaveNow }));
|
||||
await screen.findByText(translations[language].cvEditorConflict);
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[language].cvEditorBack }));
|
||||
const dialog = await screen.findByRole('dialog', { name: translations[language].cvEditorDiscardTitle });
|
||||
const reads = mockedApi.get.mock.calls.length;
|
||||
fireEvent.click(screen.getByText('Switch count language'));
|
||||
expect(screen.getByRole('dialog', { name: translations[next].cvEditorDiscardTitle })).toBe(dialog);
|
||||
expect(within(dialog).getByText(translations[next].cvEditorDiscardMessage)).toBeInTheDocument();
|
||||
expect(within(dialog).getByRole('button', { name: translations[next].cvEditorDiscardLeave })).toBeInTheDocument();
|
||||
expect(router.state.location.pathname).toBe('/career/builder/3');
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
expect(mockedApi.put).toHaveBeenCalledTimes(1);
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: translations[next].cancel }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(headline).toHaveValue('Blocked draft');
|
||||
expect(router.state.location.pathname).toBe('/career/builder/3');
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('pending custom-entry deletion follows %s language changes without changing entries', async (language) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const next = language === 'en' ? 'nb' : 'en';
|
||||
const settings = { ...variant.settings, sectionsExplicit: true, sections: [{ key: 'custom:sample' }], customSections: [{ key: 'sample', title: 'Selected projects', contentType: 'entries', items: ['First project', 'Second project'] }] };
|
||||
routeGet(() => Promise.resolve({ data: { ...variant, settings } }));
|
||||
renderAt(3, false, <SwitchCountLanguage />);
|
||||
await screen.findByDisplayValue('Backend CV');
|
||||
fireEvent.click(screen.getByRole('tab', { name: translations[language].cvEditorContent }));
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[language].cvEditorExpandSection.replace('{section}', 'Selected projects') }));
|
||||
const deleteEntry = screen.getByRole('button', { name: translations[language].cvEditorDeleteEntryNumber.replace('{number}', '1') });
|
||||
deleteEntry.focus();
|
||||
fireEvent.click(deleteEntry);
|
||||
const dialog = await screen.findByRole('dialog', { name: translations[language].cvEditorDeleteEntryTitle });
|
||||
const reads = mockedApi.get.mock.calls.length;
|
||||
fireEvent.click(screen.getByText('Switch count language'));
|
||||
expect(screen.getByRole('dialog', { name: translations[next].cvEditorDeleteEntryTitle })).toBe(dialog);
|
||||
expect(within(dialog).getByText(translations[next].cvEditorDeleteEntryMessage)).toBeInTheDocument();
|
||||
expect(within(dialog).getByText(translations[next].confirmDestructiveHint)).toBeInTheDocument();
|
||||
expect(within(dialog).getByRole('button', { name: translations[next].cvEditorDeleteEntry })).toBeInTheDocument();
|
||||
expect(screen.getByDisplayValue('First project')).toBeInTheDocument();
|
||||
expect(screen.getByDisplayValue('Second project')).toBeInTheDocument();
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: translations[next].cancel }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(deleteEntry).toHaveFocus();
|
||||
expect(screen.getByDisplayValue('First project')).toBeInTheDocument();
|
||||
expect(screen.getByDisplayValue('Second project')).toBeInTheDocument();
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
fireEvent.click(deleteEntry);
|
||||
fireEvent.click(within(await screen.findByRole('dialog')).getByRole('button', { name: translations[next].cvEditorDeleteEntry }));
|
||||
await waitFor(() => expect(screen.queryByDisplayValue('First project')).not.toBeInTheDocument());
|
||||
const remaining = screen.getByDisplayValue('Second project');
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(remaining).toHaveFocus();
|
||||
fireEvent.click(screen.getByRole('button', { name: translations[next].cvEditorSaveNow }));
|
||||
await waitFor(() => expect(mockedApi.put).toHaveBeenCalledWith('/cv/variants/3', expect.objectContaining({ expectedVersion: 4, settings: expect.objectContaining({
|
||||
customSections: [{ key: 'sample', title: 'Selected projects', contentType: 'entries', items: ['Second project'] }],
|
||||
}) })));
|
||||
expect(mockedApi.put).toHaveBeenCalledTimes(1);
|
||||
expect(mockedApi.delete).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('pending CV restore follows %s language changes and retains its version', async (language) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const next = language === 'en' ? 'nb' : 'en';
|
||||
routeGet(() => Promise.resolve({ data: variant }), { sections: [] }, [
|
||||
{ version: 3, isCurrent: false, source: 'manual', createdAtUtc: variant.updatedAtUtc },
|
||||
]);
|
||||
mockedApi.post.mockImplementation((url: string) => Promise.resolve({ data: url.endsWith('/restore') ? { ...variant, version: 5 } : { html: '<p>CV</p>' } } as any));
|
||||
renderAt(3, false, <SwitchCountLanguage />);
|
||||
await screen.findByDisplayValue('Backend CV');
|
||||
fireEvent.click(screen.getByRole('tab', { name: translations[language].cvEditorHistory }));
|
||||
const title = (locale: 'en' | 'nb') => translations[locale].cvEditorRestoreTitle.replace('{version}', '3');
|
||||
fireEvent.click(await screen.findByRole('button', { name: title(language) }));
|
||||
const dialog = await screen.findByRole('dialog', { name: title(language) });
|
||||
const reads = mockedApi.get.mock.calls.length;
|
||||
const posts = mockedApi.post.mock.calls.length;
|
||||
fireEvent.click(screen.getByText('Switch count language'));
|
||||
expect(screen.getByRole('dialog', { name: title(next) })).toBe(dialog);
|
||||
expect(within(dialog).getByText(translations[next].cvEditorRestoreMessage.replace('{version}', '3'))).toBeInTheDocument();
|
||||
expect(within(dialog).getByText(translations[next].confirmStandardHint)).toBeInTheDocument();
|
||||
expect(within(dialog).getByRole('button', { name: translations[next].cvEditorRestoreVersion })).toBeInTheDocument();
|
||||
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
|
||||
expect(mockedApi.post).toHaveBeenCalledTimes(posts);
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: translations[next].cancel }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
expect(mockedApi.post).toHaveBeenCalledTimes(posts);
|
||||
fireEvent.click(await screen.findByRole('button', { name: title(next) }));
|
||||
fireEvent.click(within(await screen.findByRole('dialog')).getByRole('button', { name: translations[next].cvEditorRestoreVersion }));
|
||||
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledWith('/cv/variants/3/versions/3/restore', { expectedVersion: 4 }));
|
||||
expect(mockedApi.post.mock.calls.filter(([url]) => String(url).endsWith('/restore'))).toHaveLength(1);
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each((['en', 'nb'] as const).flatMap(language => ['profile', 'custom'].flatMap(source => [0, 1, 2].map(count => [language, source, count] as const))))('section count grammar: %s %s %s updates locale without saving', async (language, source, count) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const items = Array.from({ length: count }, (_, i) => `Recorded item ${i}`);
|
||||
|
||||
@@ -127,7 +127,7 @@ export default function AdminUsersPage() {
|
||||
const currentTranslation = useRef(t);
|
||||
useEffect(() => { currentTranslation.current=t; }, [t]);
|
||||
useEffect(() => { const lifetime=owner.current; lifetime.mounted=true; lifetime.generation+=1; return () => { lifetime.mounted=false; lifetime.generation+=1; }; }, []);
|
||||
const userResource=useViewResource(async () => (await api.get<UserDto[]>("/users")).data ?? [], { initialData: [], errorMessage: t("adminUsersLoadFailed") });
|
||||
const userResource=useViewResource(async () => (await api.get<UserDto[]>("/users")).data ?? [], { initialData: [], errorMessage: "" });
|
||||
const users=userResource.data;
|
||||
const loading=userResource.loading || userResource.refreshing;
|
||||
const load=userResource.reload;
|
||||
@@ -179,11 +179,11 @@ export default function AdminUsersPage() {
|
||||
const name = u.userName || u.email || u.id;
|
||||
const confirmed = await confirmAction(
|
||||
u.isCurrentUser
|
||||
? t("adminUsersSelfDemoteWarning")
|
||||
: t("adminUsersDemoteWarning", { name }),
|
||||
? { key: "adminUsersSelfDemoteWarning" }
|
||||
: { key: "adminUsersDemoteWarning", params: { name } },
|
||||
{
|
||||
title: u.isCurrentUser ? t("adminUsersSelfDemoteTitle") : t("adminUsersDemoteTitle"),
|
||||
confirmLabel: t("adminUsersRemoveAdmin"),
|
||||
title: { key: u.isCurrentUser ? "adminUsersSelfDemoteTitle" : "adminUsersDemoteTitle" },
|
||||
confirmLabel: { key: "adminUsersRemoveAdmin" },
|
||||
destructive: true,
|
||||
},
|
||||
);
|
||||
@@ -201,7 +201,7 @@ export default function AdminUsersPage() {
|
||||
if (active()) toast(getApiErrorMessage(e, currentTranslation.current("adminUsersRolesUpdateFailed")), "error");
|
||||
}
|
||||
finally { finishAction(active); }
|
||||
}, [beginAction, confirmAction, finishAction, load, t, toast]);
|
||||
}, [beginAction, confirmAction, finishAction, load, toast]);
|
||||
|
||||
const sendReset = useCallback(async (u: UserDto) => {
|
||||
const active=beginAction(); if (!active) return;
|
||||
@@ -218,10 +218,10 @@ export default function AdminUsersPage() {
|
||||
const active=beginAction(); if (!active) return;
|
||||
try {
|
||||
const name = u.userName || u.email || u.id;
|
||||
const message = u.isCurrentUser
|
||||
? t("adminUsersDeleteSelfWarning")
|
||||
: t("adminUsersDeleteConfirmNamed", { name });
|
||||
if (!(await confirmAction(message, { title: t("adminUsersDeleteConfirmTitle"), confirmLabel: t("adminUsersDelete"), destructive: true })) || !active()) return;
|
||||
if (!(await confirmAction(u.isCurrentUser
|
||||
? { key: "adminUsersDeleteSelfWarning" }
|
||||
: { key: "adminUsersDeleteConfirmNamed", params: { name } },
|
||||
{ title: { key: "adminUsersDeleteConfirmTitle" }, confirmLabel: { key: "adminUsersDelete" }, destructive: true })) || !active()) return;
|
||||
const response=await api.delete(`/users/${u.id}`, { headers: { "X-Confirm-Account-Deletion": u.email || u.userName || "" } });
|
||||
if (!active()) return;
|
||||
toast(currentTranslation.current(response.status===202 ? "adminUsersDeletionQueued" : "adminUsersDeleted"), "info");
|
||||
@@ -230,7 +230,7 @@ export default function AdminUsersPage() {
|
||||
if (active()) toast(getApiErrorMessage(e, currentTranslation.current("adminUsersDeleteFailed")), "error");
|
||||
}
|
||||
finally { finishAction(active); }
|
||||
}, [beginAction, confirmAction, finishAction, load, t, toast]);
|
||||
}, [beginAction, confirmAction, finishAction, load, toast]);
|
||||
|
||||
const columns = useMemo<GridColDef[]>(() => [
|
||||
{
|
||||
@@ -301,7 +301,7 @@ export default function AdminUsersPage() {
|
||||
</Box>
|
||||
</PageSection>
|
||||
|
||||
<ViewStateNotice loading={userResource.loading} error={userResource.error} title={t("adminUsersLoadFailed")} onRetry={async () => { body.current?.focus(); await load(); }} />
|
||||
<ViewStateNotice loading={userResource.loading} error={userResource.error ? { ...userResource.error, message: userResource.error.message || t("adminUsersLoadFailed") } : null} title={t("adminUsersLoadFailed")} onRetry={async () => { body.current?.focus(); await load(); }} />
|
||||
|
||||
{!userResource.error ? isMobile ? (
|
||||
<Stack spacing={1.5}>
|
||||
|
||||
@@ -395,7 +395,7 @@ export default function CvBuilderEditor() {
|
||||
};
|
||||
|
||||
const reloadSavedVariant = async () => {
|
||||
if (!(await confirmAction(t("cvEditorConflictReloadMessage"), { title: t("cvEditorConflictReload"), confirmLabel: t("cvEditorConflictReload"), destructive: true }))) return;
|
||||
if (!(await confirmAction({ key: "cvEditorConflictReloadMessage" }, { title: { key: "cvEditorConflictReload" }, confirmLabel: { key: "cvEditorConflictReload" }, destructive: true }))) return;
|
||||
const revision = saveRevision.current;
|
||||
const epoch = editorEpoch.current;
|
||||
await saveQueue.current;
|
||||
@@ -414,9 +414,9 @@ export default function CvBuilderEditor() {
|
||||
}
|
||||
if (blockerPromptOpen.current) return;
|
||||
blockerPromptOpen.current = true;
|
||||
void confirmAction(t("cvEditorDiscardMessage"), {
|
||||
title: t("cvEditorDiscardTitle"),
|
||||
confirmLabel: t("cvEditorDiscardLeave"),
|
||||
void confirmAction({ key: "cvEditorDiscardMessage" }, {
|
||||
title: { key: "cvEditorDiscardTitle" },
|
||||
confirmLabel: { key: "cvEditorDiscardLeave" },
|
||||
destructive: true,
|
||||
}).then((confirmed) => {
|
||||
if (confirmed) blocker.proceed();
|
||||
@@ -517,9 +517,9 @@ export default function CvBuilderEditor() {
|
||||
|
||||
const restore = async (version: number) => {
|
||||
const epoch = editorEpoch.current;
|
||||
if (!(await confirmAction(t("cvEditorRestoreMessage", { version }), {
|
||||
title: t("cvEditorRestoreTitle", { version }),
|
||||
confirmLabel: t("cvEditorRestoreVersion"),
|
||||
if (!(await confirmAction({ key: "cvEditorRestoreMessage", params: { version } }, {
|
||||
title: { key: "cvEditorRestoreTitle", params: { version } },
|
||||
confirmLabel: { key: "cvEditorRestoreVersion" },
|
||||
}))) return;
|
||||
if (epoch !== editorEpoch.current) return;
|
||||
if (hasUnsavedChanges && !(await retrySave())) {
|
||||
@@ -1362,7 +1362,7 @@ function SectionRow({
|
||||
<Stack direction="row" gap={0.5}>
|
||||
<IconButton size="small" aria-label={t("cvEditorMoveEntryUp", { number: itemIndex + 1 })} disabled={itemIndex === 0} onClick={() => { onUpdateCustom({ items: moveItem(customSection.items, itemIndex, itemIndex - 1) }); focusCustomEntry(itemIndex - 1); }}><ArrowUpwardIcon fontSize="small" /></IconButton>
|
||||
<IconButton size="small" aria-label={t("cvEditorMoveEntryDown", { number: itemIndex + 1 })} disabled={itemIndex === customSection.items.length - 1} onClick={() => { onUpdateCustom({ items: moveItem(customSection.items, itemIndex, itemIndex + 1) }); focusCustomEntry(itemIndex + 1); }}><ArrowDownwardIcon fontSize="small" /></IconButton>
|
||||
<IconButton size="small" aria-label={t("cvEditorDeleteEntryNumber", { number: itemIndex + 1 })} onClick={() => void confirmAction(t("cvEditorDeleteEntryMessage"), { title: t("cvEditorDeleteEntryTitle"), confirmLabel: t("cvEditorDeleteEntry"), destructive: true }).then((confirmed) => { if (confirmed) { onUpdateCustom({ items: customSection.items.filter((_, index) => index !== itemIndex) }); focusCustomEntry(Math.max(0, Math.min(itemIndex, customSection.items.length - 2))); } })}><DeleteOutlineIcon fontSize="small" /></IconButton>
|
||||
<IconButton size="small" aria-label={t("cvEditorDeleteEntryNumber", { number: itemIndex + 1 })} onClick={() => void confirmAction({ key: "cvEditorDeleteEntryMessage" }, { title: { key: "cvEditorDeleteEntryTitle" }, confirmLabel: { key: "cvEditorDeleteEntry" }, destructive: true }).then((confirmed) => { if (confirmed) { onUpdateCustom({ items: customSection.items.filter((_, index) => index !== itemIndex) }); focusCustomEntry(Math.max(0, Math.min(itemIndex, customSection.items.length - 2))); } })}><DeleteOutlineIcon fontSize="small" /></IconButton>
|
||||
</Stack>
|
||||
</Stack>)}
|
||||
<Button ref={addEntryButton} size="small" startIcon={<AddIcon />} sx={{ alignSelf: "flex-start" }} onClick={() => { onUpdateCustom({ items: [...customSection.items, ""] }); focusCustomEntry(customSection.items.length); }}>{t("cvEditorAddEntry")}</Button>
|
||||
|
||||
Reference in New Issue
Block a user