Fix stories

This commit is contained in:
Jean Fernandez 2024-03-02 00:38:22 -05:00 committed by Jean Fernandez
parent f4454b9cac
commit a386e43772
1 changed files with 24 additions and 87 deletions

View File

@ -1,17 +1,19 @@
import type { Meta, StoryObj } from '@storybook/angular'; import type { Meta, StoryObj } from '@storybook/angular';
import { componentWrapperDecorator, moduleMetadata } from '@storybook/angular';
import {MedicalSourcesCardComponent} from './medical-sources-card.component' import {MedicalSourcesCardComponent} from './medical-sources-card.component'
import { PatientAccessBrand } from 'src/app/models/patient-access-brands';
import { ImageFallbackDirective } from 'src/app/directives/image-fallback.directive';
// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction // More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
const meta: Meta<MedicalSourcesCardComponent> = { const meta: Meta<MedicalSourcesCardComponent> = {
title: 'Components/MedicalSourcesCard', title: 'Components/MedicalSourcesCard',
component: MedicalSourcesCardComponent, component: MedicalSourcesCardComponent,
decorators: [ decorators: [
// moduleMetadata({ componentWrapperDecorator((story) => `<div style="width: 300px">${story}</div>`),
// imports: [AppModule] moduleMetadata({
// }) declarations: [ImageFallbackDirective]
// applicationConfig({ })
// providers: [importProvidersFrom(AppModule)],
// }),
], ],
tags: ['autodocs'], tags: ['autodocs'],
render: (args: MedicalSourcesCardComponent) => ({ render: (args: MedicalSourcesCardComponent) => ({
@ -33,41 +35,26 @@ const meta: Meta<MedicalSourcesCardComponent> = {
export default meta; export default meta;
type Story = StoryObj<MedicalSourcesCardComponent>; type Story = StoryObj<MedicalSourcesCardComponent>;
const brand: PatientAccessBrand = {
id: 'b53c77ed-c0f4-4d6a-bddf-5c0e3934c2d6',
name: 'Aetna',
last_updated: '2024-01-12T05:20:50.52Z',
portal_ids: []
};
// More on writing stories with args: https://storybook.js.org/docs/angular/writing-stories/args // More on writing stories with args: https://storybook.js.org/docs/angular/writing-stories/args
export const Entry: Story = { export const Entry: Story = {
args: { args: {
sourceInfo: { sourceInfo: {
metadata: { brand: brand
// aliases?: string[] },
// brand_logo?: string
category: [],
display: "Aetna",
hidden: false,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
}
}
} }
}; };
export const LoadingAuthorize: Story = { export const LoadingAuthorize: Story = {
args: { args: {
sourceInfo: { sourceInfo: {
metadata: { brand: brand
// aliases?: string[]
// brand_logo?: string
category: [],
display: "Aetna",
hidden: false,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
}
}, },
status: 'authorize' status: 'authorize'
}, },
@ -76,18 +63,7 @@ export const LoadingAuthorize: Story = {
export const LoadingToken: Story = { export const LoadingToken: Story = {
args: { args: {
sourceInfo: { sourceInfo: {
metadata: { brand: brand
// aliases?: string[]
// brand_logo?: string
category: [],
display: "Aetna",
hidden: false,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
}
}, },
status: 'token' status: 'token'
}, },
@ -96,57 +72,18 @@ export const LoadingToken: Story = {
export const Failed: Story = { export const Failed: Story = {
args: { args: {
sourceInfo: { sourceInfo: {
metadata: { brand: brand
// aliases?: string[]
// brand_logo?: string
category: [],
display: "Aetna",
hidden: false,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
}
}, },
status: 'failed' status: 'failed'
}, },
}; };
export const MissingLogo: Story = {
export const Hidden: Story = {
args: { args: {
sourceInfo: { sourceInfo: {
metadata: { brand: {
// aliases?: string[] ...brand,
// brand_logo?: string id: 'aetna-123',
category: [],
display: "Aetna",
hidden: true,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
}
}
},
};
export const CustomBrandLogo: Story = {
args: {
sourceInfo: {
metadata: {
// aliases?: string[]
brand_logo: 'bluebutton.png',
category: [],
display: "Aetna",
hidden: false,
// identifiers?: {[name:string]: string}
// patient_access_description?: string
// patient_access_url?: string
platform_type: "aetna",
source_type: "aetna"
} }
} }
}, },