mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:45:06 +00:00
[dart:html] Add back lib/html/input_element_attributes_test
Now that TextInputElement.value accepts a nullable value, this test can be added back to test null behavior. Change-Id: Ia17554314f25c5d09e113bb5c9c0a6b6f1cb1c03 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143190 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
parent
2bd4858d40
commit
53296536de
26
tests/lib/html/input_element_attributes_test.dart
Normal file
26
tests/lib/html/input_element_attributes_test.dart
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:html';
|
||||
|
||||
import 'package:expect/minitest.dart';
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
returnNothing() {}
|
||||
|
||||
// Gets an undefined value from JS.
|
||||
dynamic _undefined = returnNothing();
|
||||
|
||||
main() {
|
||||
test('valueSetNull', () {
|
||||
final e = new TextInputElement();
|
||||
e.value = null;
|
||||
expect(e.value, '');
|
||||
});
|
||||
test('valueSetNullProxy', () {
|
||||
final e = new TextInputElement();
|
||||
e.value = _undefined;
|
||||
expect(e.value, 'undefined');
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue