Skip to content

Commit

Permalink
docs: release-xxx [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
jnizet committed May 26, 2024
1 parent 3d8fe20 commit d457867
Show file tree
Hide file tree
Showing 24 changed files with 370 additions and 840 deletions.
36 changes: 27 additions & 9 deletions documentation/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@
darkModeState = darkModeStateLocal === 'true';
}
toggleDarkMode(darkModeState);

if ($darkModeToggles.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
</script>

<div class="navbar navbar-default navbar-fixed-top d-block d-sm-none">
Expand All @@ -91,6 +82,20 @@

<h1>Changelog</h1>
<p>All notable changes to this project will be documented in this file. See <a href="https://github.com/conventional-changelog/standard-version">standard-version</a> for commit guidelines.</p>
<h2><a href="https://github.com/Ninja-Squad/ngx-speculoos/compare/v11.1.0...v12.0.0">12.0.0</a> (2024-05-26)</h2>
<h3>⚠ BREAKING CHANGES</h3>
<ul>
<li><code>ngx-speculoos</code> is now based on Angular 18.x. If you want to use it with an older version of Angular, then stick to a previous version of `ngx-speculoos</li>
<li><code>TestSelect</code>&#39;s <code>selectIndex</code>, <code>selectValue</code> and <code>selectLabel</code> methods now throw if an invalid index, value or label is passed, instead of ignoring it.</li>
<li>The deprecated <code>fakeRoute</code> and <code>fakeSnapshot</code> functions have been dropped.
Use <code>stubRoute</code>, or the <code>RoutingTester</code> instead.</li>
</ul>
<h3>Features</h3>
<ul>
<li>drop the deprecated fakeRoute and fakeSnapshot functions (<a href="https://github.com/Ninja-Squad/ngx-speculoos/commit/6a5225a6c4a99cfc26ee7387d04cd68a2ca0c0c4">6a5225a</a>)</li>
<li>throw when selecting invalid index, value or label (<a href="https://github.com/Ninja-Squad/ngx-speculoos/commit/093cb5aca96732b0bcbeefb68be198fddb691bf2">093cb5a</a>)</li>
<li>upgrade to Angular and CLI 18 (<a href="https://github.com/Ninja-Squad/ngx-speculoos/commit/99af81ce92905d9ee91da5c785475e25be211b79">99af81c</a>)</li>
</ul>
<h2><a href="https://github.com/Ninja-Squad/ngx-speculoos/compare/v11.0.0...v11.1.0">11.1.0</a> (2024-02-16)</h2>
<h3>Features</h3>
<ul>
Expand Down Expand Up @@ -333,6 +338,19 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
var MAX_SEARCH_RESULTS = 15;
</script>

<script>
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
checkToggle(darkModeState);
if ($darkModeToggleSwitchers.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
</script>

<script src="./js/libs/custom-elements.min.js"></script>
<script src="./js/libs/lit-html.js"></script>

Expand Down
192 changes: 27 additions & 165 deletions documentation/classes/ActivatedRouteSnapshotStub.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@
darkModeState = darkModeStateLocal === 'true';
}
toggleDarkMode(darkModeState);

if ($darkModeToggles.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
</script>

<div class="navbar navbar-default navbar-fixed-top d-block d-sm-none">
Expand Down Expand Up @@ -197,7 +188,7 @@ <h3 id="constructor">Constructor</h3>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="254" class="link-to-prism">src/lib/route.ts:254</a></div>
<div class="io-line">Defined in <a href="" data-line="112" class="link-to-prism">src/lib/route.ts:112</a></div>
</td>
</tr>

Expand Down Expand Up @@ -232,7 +223,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="208" class="link-to-prism">src/lib/route.ts:208</a></div>
<div class="io-line">Defined in <a href="" data-line="66" class="link-to-prism">src/lib/route.ts:66</a></div>
</td>
</tr>

Expand All @@ -243,7 +234,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="212" class="link-to-prism">src/lib/route.ts:212</a></div>
<div class="io-line">Defined in <a href="" data-line="70" class="link-to-prism">src/lib/route.ts:70</a></div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -301,7 +292,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="216" class="link-to-prism">src/lib/route.ts:216</a></div>
<div class="io-line">Defined in <a href="" data-line="74" class="link-to-prism">src/lib/route.ts:74</a></div>
</td>
</tr>

Expand All @@ -312,7 +303,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="220" class="link-to-prism">src/lib/route.ts:220</a></div>
<div class="io-line">Defined in <a href="" data-line="78" class="link-to-prism">src/lib/route.ts:78</a></div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -370,7 +361,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="224" class="link-to-prism">src/lib/route.ts:224</a></div>
<div class="io-line">Defined in <a href="" data-line="82" class="link-to-prism">src/lib/route.ts:82</a></div>
</td>
</tr>

Expand All @@ -381,7 +372,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="228" class="link-to-prism">src/lib/route.ts:228</a></div>
<div class="io-line">Defined in <a href="" data-line="86" class="link-to-prism">src/lib/route.ts:86</a></div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -439,7 +430,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="232" class="link-to-prism">src/lib/route.ts:232</a></div>
<div class="io-line">Defined in <a href="" data-line="90" class="link-to-prism">src/lib/route.ts:90</a></div>
</td>
</tr>

Expand All @@ -450,7 +441,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="236" class="link-to-prism">src/lib/route.ts:236</a></div>
<div class="io-line">Defined in <a href="" data-line="94" class="link-to-prism">src/lib/route.ts:94</a></div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -508,7 +499,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="240" class="link-to-prism">src/lib/route.ts:240</a></div>
<div class="io-line">Defined in <a href="" data-line="98" class="link-to-prism">src/lib/route.ts:98</a></div>
</td>
</tr>

Expand All @@ -519,7 +510,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="244" class="link-to-prism">src/lib/route.ts:244</a></div>
<div class="io-line">Defined in <a href="" data-line="102" class="link-to-prism">src/lib/route.ts:102</a></div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -577,7 +568,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="248" class="link-to-prism">src/lib/route.ts:248</a></div>
<div class="io-line">Defined in <a href="" data-line="106" class="link-to-prism">src/lib/route.ts:106</a></div>
</td>
</tr>

Expand All @@ -599,7 +590,7 @@ <h3 id="accessors">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="252" class="link-to-prism">src/lib/route.ts:252</a></div>
<div class="io-line">Defined in <a href="" data-line="110" class="link-to-prism">src/lib/route.ts:110</a></div>
</td>
</tr>

Expand All @@ -611,149 +602,7 @@ <h3 id="accessors">

<div class="tab-pane fade tab-source-code" id="source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ActivatedRoute, ActivatedRouteSnapshot, convertToParamMap, Data, ParamMap, Params, Route, UrlSegment } from &#x27;@angular/router&#x27;;
import { BehaviorSubject, map, Observable } from &#x27;rxjs&#x27;;
import { Type } from &#x27;@angular/core&#x27;;

/**
* Creates a fake partial ActivatedRoute for tests.
*
* If you pass params, then the created route&#x27;s paramMap will contain the same values.
* The same goes for queryParams and queryParamMap.
*
* If you pass a parent route and a snapshot, and the passed snapshot doesn&#x27;t have a parent, then the snapshot&#x27;s
* parent will be set to the parent route snapshot. This allows the code under test to use
* &#x60;route.parent.snapshot&#x60; or &#x60;route.snapshot.parent&#x60;.
*
* If you pass a snapshot with a parent, but don&#x27;t pass a parent or pass a parent without snapshot, then the route&#x27;s
* parent snapshot will be set to the given snapshot&#x27;s parent. This allows the code under test to use
* &#x60;route.parent.snapshot&#x60; or &#x60;route.snapshot.parent&#x60;.
*
* @returns a partially populated, fake ActivatedRoute, depending on what you passed in
* @deprecated favor stubRoute, which creates an easier to use and more logical stub
*/
export function fakeRoute(options: {
url?: Observable&lt;UrlSegment[]&gt;;
/** An observable of the matrix parameters scoped to this route */
params?: Observable&lt;Params&gt;;
/** An observable of the query parameters shared by all the routes */
queryParams?: Observable&lt;Params&gt;;
/** An observable of the URL fragment shared by all the routes */
fragment?: Observable&lt;string&gt;;
/** An observable of the static and resolved data of this route. */
data?: Observable&lt;Data&gt;;
/** The outlet name of the route. It&#x27;s a constant */
outlet?: string;
/** The component of the route. It&#x27;s a constant */
component?: Type&lt;unknown&gt; | string | null;
/** The current snapshot of this route */
snapshot?: ActivatedRouteSnapshot;
/** The configuration used to match this route */
routeConfig?: Route | null;
/** The root of the router state */
root?: ActivatedRoute;
/** The parent of this route in the router state tree */
parent?: ActivatedRoute | null;
/** The first child of this route in the router state tree */
firstChild?: ActivatedRoute;
/** The children of this route in the router state tree */
children?: ActivatedRoute[];
/** The path from the root of the router state tree to this route */
pathFromRoot?: ActivatedRoute[];
}): ActivatedRoute {
const result &#x3D; {
url: options.url,
params: options.params,
paramMap: options.params &amp;&amp; options.params.pipe(map(params &#x3D;&gt; convertToParamMap(params))),
queryParams: options.queryParams,
queryParamMap: options.queryParams &amp;&amp; options.queryParams.pipe(map(params &#x3D;&gt; convertToParamMap(params))),
fragment: options.fragment,
data: options.data,
outlet: options.outlet,
component: options.component,
snapshot: options.snapshot,
routeConfig: options.routeConfig,
root: options.root,
parent: options.parent,
firstChild: options.firstChild,
children: options.children,
pathFromRoot: options.pathFromRoot
} as ActivatedRoute;

for (let route: null | ActivatedRoute &#x3D; result; route; route &#x3D; route.parent) {
if (route.parent &amp;&amp; route.parent.snapshot &amp;&amp; !route.snapshot) {
// eslint-disable-next-line deprecation/deprecation
route.snapshot &#x3D; fakeSnapshot({});
}
if (route.parent &amp;&amp; route.parent.snapshot &amp;&amp; !route.snapshot.parent) {
(route.snapshot as Omit&lt;ActivatedRouteSnapshot, &#x27;parent&#x27;&gt; &amp; { parent: ActivatedRouteSnapshot }).parent &#x3D; route.parent.snapshot;
}

if (route.snapshot &amp;&amp; route.snapshot.parent &amp;&amp; !route.parent) {
// eslint-disable-next-line deprecation/deprecation
(route as Omit&lt;ActivatedRoute, &#x27;parent&#x27;&gt; &amp; { parent: ActivatedRoute }).parent &#x3D; fakeRoute({});
}
if (route.snapshot &amp;&amp; route.snapshot.parent &amp;&amp; route.parent &amp;&amp; !route.parent.snapshot) {
route.parent.snapshot &#x3D; route.snapshot.parent;
}
}

return result;
}

/**
* Creates a fake partial ActivatedRouteSnapshot for tests.
*
* If you pass params, then the created snapshot&#x27;s paramMap will contain the same values.
* The same goes for queryParams and queryParamMap.
*
* @returns a partially populated, fake ActivatedRoute, depending on what you passed in
* @deprecated favor stubRoute, which creates an easier to use and more logical stub for both the route and its snapshot
*/
export function fakeSnapshot(options: {
url?: UrlSegment[];
/** The matrix parameters scoped to this route */
params?: Params;
/** The query parameters shared by all the routes */
queryParams?: Params;
/** The URL fragment shared by all the routes */
fragment?: string;
/** The static and resolved data of this route */
data?: Data;
/** The outlet name of the route */
outlet?: string;
/** The component of the route */
component?: Type&lt;unknown&gt; | string | null;
/** The configuration used to match this route */
routeConfig?: Route;
/** The root of the router state */
root?: ActivatedRouteSnapshot;
/** The parent of this route in the router state tree */
parent?: ActivatedRouteSnapshot | null;
/** The first child of this route in the router state tree */
firstChild?: ActivatedRouteSnapshot | null;
/** The children of this route in the router state tree */
children?: ActivatedRouteSnapshot[];
/** The path from the root of the router state tree to this route */
pathFromRoot?: ActivatedRouteSnapshot[];
}): ActivatedRouteSnapshot {
return {
url: options.url,
params: options.params,
paramMap: options.params &amp;&amp; convertToParamMap(options.params),
queryParams: options.queryParams,
queryParamMap: options.queryParams &amp;&amp; convertToParamMap(options.queryParams),
fragment: options.fragment,
data: options.data,
outlet: options.outlet,
component: options.component,
routeConfig: options.routeConfig,
root: options.root,
parent: options.parent,
firstChild: options.firstChild,
children: options.children,
pathFromRoot: options.pathFromRoot
} as ActivatedRouteSnapshot;
}
import { BehaviorSubject } from &#x27;rxjs&#x27;;

/**
* The options that are passed when creating an ActivatedRouteStub.
Expand Down Expand Up @@ -1173,6 +1022,19 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
var MAX_SEARCH_RESULTS = 15;
</script>

<script>
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
checkToggle(darkModeState);
if ($darkModeToggleSwitchers.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
</script>

<script src="../js/libs/custom-elements.min.js"></script>
<script src="../js/libs/lit-html.js"></script>

Expand Down
Loading

0 comments on commit d457867

Please sign in to comment.