dart-sdk/tests/lib/html/input_element_attributes_test.dart
Srujan Gaddam 53296536de [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>
2020-04-14 00:37:41 +00:00

27 lines
666 B
Dart

// 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');
});
}