-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1813 from DSD-DBS/add-identity-provider-to-story
test: Add authentication provider to Auth component stories
- Loading branch information
Showing
3 changed files
with
64 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { Observable, of } from 'rxjs'; | ||
import { | ||
MetadataService, | ||
Version, | ||
} from 'src/app/general/metadata/metadata.service'; | ||
import { Metadata } from 'src/app/openapi'; | ||
|
||
export const mockMetadata: Metadata = { | ||
version: '1.0.0', | ||
privacy_policy_url: 'https://example.com/privacy', | ||
imprint_url: 'https://example.com/imprint', | ||
provider: 'Provider', | ||
authentication_provider: 'Identity Provider', | ||
environment: 'Storybook Environment', | ||
host: 'localhost', | ||
port: '6006', | ||
protocol: 'http', | ||
}; | ||
|
||
export class MockMetadataService implements Partial<MetadataService> { | ||
public readonly backendMetadata: Observable<Metadata | undefined> = | ||
of(undefined); | ||
public version: Version | undefined; | ||
public oldVersion: string | undefined; | ||
public changedVersion = false; | ||
|
||
constructor( | ||
metadata: Metadata | undefined, | ||
version?: Version | undefined, | ||
oldVersion?: string | undefined, | ||
changedVersion?: boolean, | ||
) { | ||
this.backendMetadata = of(metadata); | ||
this.version = version; | ||
this.oldVersion = oldVersion; | ||
if (changedVersion) this.changedVersion = changedVersion; | ||
} | ||
} |