Commit 8e8fb9d
* Port #1260 to dtq-dev-9-base: License-contract page refactor - restore the dropped spec
TESTS-ONLY. The runtime half of #1260 (list mode without a collectionId,
PaginationService-driven paging, loadAuthorizedCollections, clearPagination on
destroy) is already on the v9 base and matches the source hunk for hunk; the v9
squash dropped the spec file whole. This restores it, so the six behaviours the
refactor introduced are pinned again.
The six assertions are the fork's, unchanged: component creation, collectionRD$,
licenseRD$, hasFailed on a bogus collectionId, list mode loading authorized
collections when the query param is missing, and clearPagination on destroy in
list mode.
v9 notes:
- declarations:[LicenseContractPageComponent, MockNgVarDirective] ->
imports:[LicenseContractPageComponent]. The component is standalone and imports
the real VarDirective, so the fork's *ngVar mock directive is dropped rather
than adapted - keeping it would shadow the directive under test.
- ErrorComponent, PaginationComponent and ThemedLoadingComponent are removed from
the component's own imports via overrideComponent and NO_ERRORS_SCHEMA is added
there, because two of the tests render list mode and PaginationComponent pulls
in a provider graph this spec has no business standing up.
- `of` instead of the fork's `of as observableOf` (dspace-angular-ts/alias-imports).
- The getAuthorizedCollection assertion is new and v9-specific: it pins the 6-arg
signature including the mandatory searchHref 'findSubmitAuthorized', which is
exactly the one place the v9 runtime differs from the source commit.
- routeStub/collectionService/paginationService are const (the fork's `let` +
later assignment trips prefer-const on v9).
Card PB-06 (tranche T3).
Source: f2fe67b (dtq-dev PR #1260)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Port #1241 to dtq-dev-9-base: Static pages - SSR render and 404 - restore the two dropped specs
TESTS-ONLY. The runtime half of #1241 is on the v9 base: HtmlContentService
resolves namespace-aware URLs and, under SSR, absolute ones from the express
REQUEST; StaticPageComponent tracks contentState and calls
ServerResponseService.setNotFound() so a missing static page really answers 404.
The v9 squash dropped both spec files whole. This restores them.
html-content.service.spec.ts - the fork's 5 tests plus 5 that pin the v9-only
half of the service:
- namespaced URL for the default locale, localized URL for a non-default locale,
fallback localized -> default (twice, with and without a trailing slash on the
namespace), and getHtmlContent swallowing a failure into ''.
- NEW: on the server with a REQUEST the request URL is absolute
(https://host/repository/...), on the server without one it stays relative, in
the browser the REQUEST is ignored, a URL that already carries the namespace is
not prefixed twice, and an absolute http(s) URL is left alone.
The first of these is the assertion the card asks for: it fails loudly if
REQUEST is imported from the wrong module, because @optional() injection would
then silently hand the service undefined and the URL would stay relative. The
"no REQUEST" test is its counterpart, so the pair cannot both pass by accident.
static-page.component.spec.ts - the fork's 19 tests unchanged in substance:
creation, content load, file name from the route, the five OAI-link rewrite
cases, the five contentState cases (including 'not-found' plus setNotFound()),
the two change-detection cases and the four link-handling cases.
v9 notes:
- LocaleService.getCurrentLanguageCode() returns an Observable on v9, not a
string, so the stub returns of(languageCode). That also puts a microtask
between the call and the HTTP request, so the two non-fakeAsync tests await a
settle() before expectOne; the fakeAsync ones tick(). Without this the fork's
spec would fail here - it is a real behavioural difference, not a flake.
- HttpClientTestingModule -> provideHttpClient() + provideHttpClientTesting()
(the module is deprecated on Angular 20; this is what the other v9 specs use).
- declarations:[StaticPageComponent, ClarinSafeHtmlPipe] ->
imports:[StaticPageComponent]; the pipe is one of the component's own imports.
RouterModule and ThemedLoadingComponent are removed from those imports via
overrideComponent with NO_ERRORS_SCHEMA, because the loading and 404 branches
render <ds-loading> and routerLink and would otherwise need the theme and
router provider graphs.
- submission-section-cc-licenses.component.spec.ts is deliberately NOT touched:
the third hunk of #1241 added fakeAsync/tick(350) around a debounceTime that
the v9 component does not have (grep debounceTime -> 0).
Card PB-07 (tranche T3).
Source: f8495ea (dtq-dev PR #1241)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c65a7ff commit 8e8fb9d
3 files changed
Lines changed: 736 additions & 0 deletions
File tree
- src/app
- license-contract-page
- static-page
Lines changed: 204 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
0 commit comments