1
0
Fork 0
thinking-in-stories-compone.../tests/integration/components/contact-card-test.js
Ava Gaiety Wroten 756ba24d21 Initial commit
2022-04-05 12:26:52 -05:00

37 lines
1 KiB
JavaScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import {
Standard,
Admin,
} from 'emberconf-2022/components/contact-card.stories';
import { renderStory } from '@storybook/ember-cli-storybook/test-support';
module('Integration | Component | contact-card', function (hooks) {
setupRenderingTest(hooks);
test('it renders expected name', async function (assert) {
await renderStory(Standard);
assert.dom('[data-testid=cc-name]').includesText(Standard.args.name);
});
test('it renders an avatar', async function (assert) {
await renderStory(Standard);
assert
.dom('[data-testid=cc-avatar]')
.hasAttribute('src', Standard.args.avatar);
});
test('it is not an admin by default', async function (assert) {
await renderStory(Standard);
assert.dom('[data-testid=cc-admin]').doesNotExist();
});
test('it can be an admin', async function (assert) {
await renderStory(Admin);
assert.dom('[data-testid=cc-admin]').exists();
});
});