Skip to content

Commit

Permalink
docs(spectacular): add version 14.1 (#73)
Browse files Browse the repository at this point in the history
Merge pull request #73 from ngworker/spectacular/docs/add-v14_0-snapshot
  • Loading branch information
LayZeeDK committed Jul 21, 2023
2 parents eba7561 + 6445173 commit cbd80c2
Show file tree
Hide file tree
Showing 26 changed files with 4,015 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/spectacular-docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
lastVersion: 'current',
versions: {
current: {
label: '14.0',
label: '14.1',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: "API"
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
id: "SpectacularAppComponent"
title: "Class: SpectacularAppComponent"
sidebar_label: "SpectacularAppComponent"
sidebar_position: 0
custom_edit_url: null
---

The root component which is bootstrapped for a Spectacular test.

## Constructors

### constructor

**new SpectacularAppComponent**()

## Properties

### routerOutlet

`Optional` **routerOutlet**: `RouterOutlet`

The router outlet of the root component.

**`See`**

`getActiveComponent`.

#### Defined in

[packages/spectacular/src/lib/shared/app-component/spectacular-app.component.ts:23](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/shared/app-component/spectacular-app.component.ts#L23)

## Methods

### getActiveComponent

**getActiveComponent**<`TActiveComponent`\>(): `TActiveComponent`

Get the active top-level routed component, for example a page component.

#### Type parameters

| Name |
| :------ |
| `TActiveComponent` |

#### Returns

`TActiveComponent`

#### Defined in

[packages/spectacular/src/lib/shared/app-component/spectacular-app.component.ts:28](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/shared/app-component/spectacular-app.component.ts#L28)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: "SpectacularFeatureLocation"
title: "Class: SpectacularFeatureLocation"
sidebar_label: "SpectacularFeatureLocation"
sidebar_position: 0
custom_edit_url: null
---

A subset of Angular's `Location` service adjusted to the Angular feature
module under test.

## Constructors

### constructor

**new SpectacularFeatureLocation**()

## Methods

### path

**path**(`includeHash?`): `string`

Normalizes the URL path for this location. URLs within the Angular feature
module under test are prefixed with tilde (`~`).

Wraps `Location#path`.

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `includeHash` | `boolean` | `false` | True to include an anchor fragment in the path. Optional. Default is `false`. |

#### Returns

`string`

#### Defined in

[packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-location.ts:26](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-location.ts#L26)
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
id: "SpectacularFeatureRouter"
title: "Class: SpectacularFeatureRouter"
sidebar_label: "SpectacularFeatureRouter"
sidebar_position: 0
custom_edit_url: null
---

A subset of Angular's `Router` server adjusted to the Angular feature module
under test.

## Constructors

### constructor

**new SpectacularFeatureRouter**()

## Methods

### navigate

**navigate**(`commands`, `extras?`): `Promise`<`boolean`\>

Navigate based on the provided array of commands and a starting point. If
no starting route is provided, the navigation is absolute.

If the first command is a tilde (`~`), the navigation is relative to the
feature under test.

Wraps `Router#navigate`.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `commands` | `any`[] | An array of URL fragments with which to construct the target URL. If the path is static, can be the literal URL string. For a dynamic path, pass an array of path segments, followed by the parameters for each segment. The fragments are applied to the current URL or the one provided in the relativeTo property of the options object, if supplied. If the first command is a tilde (`~`), the navigation is relative to the feature under test. |
| `extras?` | `NavigationExtras` | An options object that determines how the URL should be constructed or interpreted. Optional. Default is `{ skipLocationChange: false }`. |

#### Returns

`Promise`<`boolean`\>

#### Defined in

[packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-router.ts:38](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-router.ts#L38)

___

### navigateByUrl

**navigateByUrl**(`url`, `extras?`): `Promise`<`boolean`\>

Navigates to a view using an absolute route path.

If the URL is prefixed with tilde (`~`), the navigation is relative to the
feature under test.

Wraps `Router#navigateByUrl`.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `url` | `string` \| `UrlTree` | An absolute path for a defined route. The function does not apply any delta to the current URL. If the URL is prefixed with tilde (`~`), the navigation is relative to the feature under test. |
| `extras?` | `NavigationExtras` | An object containing properties that modify the navigation strategy. Optional. Default is `{ skipLocationChange: false }`. |

#### Returns

`Promise`<`boolean`\>

#### Defined in

[packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-router.ts:62](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/navigation/spectacular-feature-router.ts#L62)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: "SpectacularFeatureTestingModule"
title: "Class: SpectacularFeatureTestingModule"
sidebar_label: "SpectacularFeatureTestingModule"
sidebar_position: 0
custom_edit_url: null
---

Configure the `RouterTestingModule` and provide Spectactular services for
testing feature modules.

NOTE! Do not import directly. Use `SpectacularFeatureTestingModule.withFeature`.

NOTE! Prefer to use `createFeatureHarness`. This Angular module is a low
level building block in case you need more control over your test setup.

## Constructors

### constructor

**new SpectacularFeatureTestingModule**()

#### Defined in

[packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing.module.ts:67](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing.module.ts#L67)

## Methods

### withFeature

`Static` **withFeature**(`options`): `ModuleWithProviders`<[`SpectacularFeatureTestingRootModule`](SpectacularFeatureTestingRootModule.md)\>

Configures the `RouterTestingModule` and provides Spectactular
services for testing feature modules

#### Parameters

| Name | Type |
| :------ | :------ |
| `options` | [`SpectacularFeatureTestingModuleOptions`](../interfaces/SpectacularFeatureTestingModuleOptions.md) |

#### Returns

`ModuleWithProviders`<[`SpectacularFeatureTestingRootModule`](SpectacularFeatureTestingRootModule.md)\>

#### Defined in

[packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing.module.ts:50](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing.module.ts#L50)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: "SpectacularFeatureTestingRootModule"
title: "Class: SpectacularFeatureTestingRootModule"
sidebar_label: "SpectacularFeatureTestingRootModule"
sidebar_position: 0
custom_edit_url: null
---

Static dependencies for feature testing.

Guards against registration in multiple Angular modules.

NOTE! Only to be imported by `SpectacularFeatureTestingModule`.

## Constructors

### constructor

**new SpectacularFeatureTestingRootModule**()

#### Defined in

[packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing-root.module.ts:16](https://github.com/ngworker/ngworker/blob/d3bf6f9/packages/spectacular/src/lib/feature-testing/feature-testing-module/spectacular-feature-testing-root.module.ts#L16)
Loading

0 comments on commit cbd80c2

Please sign in to comment.