Charlie Tran c2c6f66ca8
feat(frontend): Module consolidation for some test modules and reduces errors from unsupported API calls (#1844)
* frontend - Module consolidation for some test modules and reduces errors from unsupported API calls

* Fix broken test
2020-09-03 10:37:02 -07:00

35 lines
1.1 KiB
TypeScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { DatasetEntity } from '@datahub/data-models/entity/dataset/dataset-entity';
module('Integration | Component | dynamic-components/entity/field', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
const fakeSeedInformation = {
dataset: {
description: `Pikachu's special dataset`
}
};
const testUnderlyingDataset = new DatasetEntity(
'pikachu',
(fakeSeedInformation as unknown) as Com.Linkedin.Dataset.Dataset
);
this.setProperties({
entity: testUnderlyingDataset,
className: 'test-class'
});
await render(hbs`
<DynamicComponents::Entity::Field
@options={{hash fieldName="description" className=this.className}}
@entity={{this.entity}}
/>
`);
assert.dom('.test-class').hasText(`Pikachu's special dataset`, 'Renders the expected field and class name');
});
});