From f1657179ec8070ec8a25707524723f2b98d3cc23 Mon Sep 17 00:00:00 2001 From: dsalamau Date: Sun, 2 Dec 2018 23:11:08 +0300 Subject: [PATCH] Add tests to setTopValues() behavior --- test/behaviors/select_component_behaviors_test.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/behaviors/select_component_behaviors_test.dart b/test/behaviors/select_component_behaviors_test.dart index 38e1d74..0a30994 100644 --- a/test/behaviors/select_component_behaviors_test.dart +++ b/test/behaviors/select_component_behaviors_test.dart @@ -31,6 +31,13 @@ void main() { option.text = o.replaceAll('_', ''); options_container.append(option); }); + + var template_option = new DivElement(); + template_option.attributes["data-component-part"] = "option_template"; + template_option.attributes["data-option-value"] = "option_template"; + template_option.text = "option template"; + options_container.append(template_option); + option_els = options_container.children; } @@ -81,6 +88,12 @@ void main() { expect(option_els.first.classes, contains("optionSeparator")); }); + test("moves to top values specified in `top_values`", () { + select_comp.top_values = "option_template"; + behaviors.setTopValues(); + expect(option_els.first.text, equals("option template")); + }); + group("ajax indicator", () { var ai;