Fix custom UI validation bugs (#1583)

This commit is contained in:
Matt Irvine
2018-06-08 15:32:21 -07:00
committed by GitHub
parent 02af7e9299
commit 20c4f085c8
3 changed files with 17 additions and 3 deletions

View File

@@ -118,4 +118,14 @@ suite('ExtHostModelView Validation Tests', () => {
});
assert.equal(inputBox.valid, true, 'Input box did not update validity to true based on the validityChanged event');
});
test('Main thread validityChanged events cause component to fire validity changed events', () => {
let validityFromEvent: boolean = undefined;
inputBox.onValidityChanged(valid => validityFromEvent = valid);
extHostModelView.$handleEvent(handle, inputBox.id, {
eventType: ComponentEventType.validityChanged,
args: false
});
assert.equal(validityFromEvent, false, 'Main thread validityChanged event did not cause component to fire its own event');
});
});