diff --git a/npm/ng-packs/packages/theme-shared/src/lib/tests/card.component.spec.ts b/npm/ng-packs/packages/theme-shared/src/lib/tests/card.component.spec.ts new file mode 100644 index 0000000000..3dbc2156f1 --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/tests/card.component.spec.ts @@ -0,0 +1,75 @@ +import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest'; +import { + CardComponent, + CardBodyComponent, + CardFooterComponent, + CardHeaderComponent, + CardHeader, + CardTitle, + CardImgTop, + CardSubtitle, +} from '../components/card'; + +describe('CardComponent', () => { + let spectator: SpectatorHost; + + const createHost = createHostFactory({ + component: CardComponent, + declarations: [ + CardHeaderComponent, + CardTitle, + CardSubtitle, + CardBodyComponent, + CardImgTop, + CardFooterComponent, + ], + }); + + beforeEach( + () => + (spectator = createHost( + ` + + + Card title +

Card subtitle

+
+ + +

Some quick example text to build on the card title and make up the bulk of the card's content.

+
+ + Go somewhere + +
+ `, + { + hostProps: { attributes: { autofocus: '', name: 'abp-card' } }, + }, + )), + ); + + it('should display the card-header', () => { + expect(spectator.query('abp-card-header')).toBeTruthy(); + }); + + it('should display the card-title', () => { + expect(spectator.query('abp-card-title')).toBeTruthy(); + }); + + it('should display the card-subtitle', () => { + expect(spectator.query('p[abp-card-subtitle]')).toBeTruthy(); + }); + + it('should display the card-body', () => { + expect(spectator.query('abp-card-body')).toBeTruthy(); + }); + + it('should display the card-img-top', () => { + expect(spectator.query('abp-card-img-top')).toBeTruthy(); + }); + + it('should display the card-footer', () => { + expect(spectator.query('abp-card-footer')).toBeTruthy(); + }); +});