Skip to content

Commit ca102ea

Browse files
WilcoLouwerseclaude
andcommitted
test(cmdb-import): mock the mapping block's icons and read the shipped missing-records modes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7eb4ca6 commit ca102ea

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/views/settings/sections/CmdbImport.spec.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jest.mock('vue-material-design-icons/DatabaseImport.vue', () => ({
5555
jest.mock('vue-material-design-icons/TrayArrowUp.vue', () => ({
5656
render: () => null,
5757
}))
58+
jest.mock('vue-material-design-icons/ChevronDown.vue', () => ({
59+
render: () => null,
60+
}))
61+
jest.mock('vue-material-design-icons/ChevronUp.vue', () => ({
62+
render: () => null,
63+
}))
5864
jest.mock('../../../components/AlwaysVisibleSection.vue', () => ({
5965
render: () => null,
6066
}))

‎tests/Unit/Controller/SettingsControllerCmdbImportMappingTest.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ public function testTheShippedMappingIsAnsweredFlat(): void {
204204
$this->assertSame('Applicatie Naam', $data['profile']['nameColumn']);
205205
$this->assertSame(['APPID', 'Applicatie Naam'], $data['profile']['requiredColumns']);
206206
$this->assertSame(['Datum', 'Referentie datum wijziging', 'End-of-Life Functioneel'], $data['profile']['dateColumns']);
207-
$this->assertSame(['keep'], $data['profile']['missingRecords']);
207+
// The modes the shipped profile declares, read from the file so the
208+
// assertion follows the profile instead of pinning one release's list.
209+
$shipped = json_decode((string)file_get_contents(__DIR__ . '/../../../lib/Settings/cmdb-import/topdesk-profile.json'), true);
210+
$this->assertSame($shipped['missingRecords'], $data['profile']['missingRecords']);
208211
$this->assertSame('topdesk-profile.json', $data['profile']['profileFile']);
209212

210213
$this->assertSame(CmdbImportProfile::TARGETS, array_column($data['packs'], 'target'));

0 commit comments

Comments
 (0)