|
1 | 1 | import { render, screen } from '@testing-library/angular'; |
2 | 2 | import { FeatureTypeFormComponent } from './feature-type-form.component'; |
3 | 3 | import { of } from 'rxjs'; |
4 | | -import { getFeatureTypeSummary } from '@tailormap-admin/admin-api'; |
| 4 | +import { FeatureTypeModel } from '@tailormap-admin/admin-api'; |
5 | 5 | import { SharedModule } from '@tailormap-viewer/shared'; |
6 | | -import { ExtendedFeatureTypeModel } from '../models/extended-feature-type.model'; |
7 | 6 | import { FeatureSourceService } from '../services/feature-source.service'; |
8 | 7 | import { FeatureTypeAttributesComponent } from '../feature-type-attributes/feature-type-attributes.component'; |
9 | 8 | import { SaveButtonComponent } from '../../shared/components/save-button/save-button.component'; |
10 | 9 | import { SpinnerButtonComponent } from '@tailormap-viewer/shared'; |
11 | | -import { CatalogExtendedTypeEnum } from '../models/catalog-extended.model'; |
12 | 10 | import { createMockStore } from '@ngrx/store/testing'; |
13 | 11 | import { catalogStateKey, initialCatalogState } from '../state/catalog.state'; |
14 | 12 | import { Store } from '@ngrx/store'; |
| 13 | +import { |
| 14 | + FeatureTypeAttachmentAttributesComponent, |
| 15 | +} from '../feature-type-attachment-attributes/feature-type-attachment-attributes.component'; |
| 16 | +import { MatIconTestingModule } from '@angular/material/icon/testing'; |
15 | 17 |
|
16 | 18 | const setup = async () => { |
17 | 19 | const featureSourceService = { updateFeatureSource$: jest.fn(() => of({})) }; |
18 | | - const featureTypeModel: ExtendedFeatureTypeModel = { |
19 | | - ...getFeatureTypeSummary({ name: 'ft_1', title: 'some table' }), |
| 20 | + const featureTypeModel: FeatureTypeModel = { |
| 21 | + attributes: [], |
| 22 | + defaultGeometryAttribute: null, |
| 23 | + primaryKeyAttribute: null, |
| 24 | + settings: { |
| 25 | + attributeSettings: {}, |
| 26 | + }, |
20 | 27 | id: '1_ft_1', |
21 | | - originalId: 'ft_1', |
22 | | - featureSourceId: '1', |
23 | | - catalogNodeId: 'node-1', |
24 | | - type: CatalogExtendedTypeEnum.FEATURE_TYPE_TYPE, |
| 28 | + name: 'ft_1', |
| 29 | + title: 'some table', |
25 | 30 | }; |
26 | 31 | const mockStore = createMockStore({ |
27 | 32 | initialState: { [catalogStateKey]: { ...initialCatalogState } }, |
28 | 33 | }); |
29 | 34 | await render(FeatureTypeFormComponent, { |
30 | | - declarations: [ FeatureTypeAttributesComponent, SaveButtonComponent, SpinnerButtonComponent ], |
31 | | - imports: [SharedModule], |
| 35 | + declarations: [ |
| 36 | + FeatureTypeAttributesComponent, |
| 37 | + FeatureTypeAttachmentAttributesComponent, |
| 38 | + SaveButtonComponent, |
| 39 | + SpinnerButtonComponent, |
| 40 | + ], |
| 41 | + imports: [ SharedModule, MatIconTestingModule ], |
32 | 42 | inputs: { |
33 | 43 | featureType: featureTypeModel, |
34 | 44 | }, |
|
0 commit comments