Initial
This commit is contained in:
@@ -5,6 +5,7 @@ import { load } from './setup.mjs';
|
||||
|
||||
const {
|
||||
buildHostPayloadFromVm,
|
||||
filterSummaryVms,
|
||||
normalizeBaseUrl,
|
||||
normalizeVCenterVm,
|
||||
vmMatchesFilter
|
||||
@@ -37,6 +38,17 @@ test('vmMatchesFilter supports hostname contains and IP equals matching', () =>
|
||||
assert.equal(vmMatchesFilter(candidate, { field: 'fqdn', operator: 'startsWith', value: 'db' }), false);
|
||||
});
|
||||
|
||||
test('filterSummaryVms scans the full VM summary list for VM-name filters', () => {
|
||||
const vms = [
|
||||
...Array.from({ length: 900 }, (_, index) => ({ vm: `vm-${index}`, name: `ZZZ-${index}` })),
|
||||
{ vm: 'vm-901', name: 'MCS-WIN-APP01' }
|
||||
];
|
||||
const matched = filterSummaryVms(vms, { field: 'name', operator: 'contains', value: 'MCS' });
|
||||
|
||||
assert.equal(matched.length, 1);
|
||||
assert.equal(matched[0].name, 'MCS-WIN-APP01');
|
||||
});
|
||||
|
||||
test('buildHostPayloadFromVm attaches credential, tags, transport, and import notes', () => {
|
||||
const payload = buildHostPayloadFromVm(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user