summaryrefslogtreecommitdiff
path: root/vendor/oojs/oojs-ui/bin/testsuitegenerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/oojs/oojs-ui/bin/testsuitegenerator.rb')
-rw-r--r--vendor/oojs/oojs-ui/bin/testsuitegenerator.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/oojs/oojs-ui/bin/testsuitegenerator.rb b/vendor/oojs/oojs-ui/bin/testsuitegenerator.rb
index 28ab1a85..48ba012c 100644
--- a/vendor/oojs/oojs-ui/bin/testsuitegenerator.rb
+++ b/vendor/oojs/oojs-ui/bin/testsuitegenerator.rb
@@ -18,7 +18,7 @@ else
.reject{|c| c[:abstract] } # can't test abstract classes
.reject{|c| !c[:parent] || c[:parent] == 'ElementMixin' || c[:parent] == 'Theme' } # can't test abstract
.reject{|c| %w[Element Widget Layout Theme].include? c[:name] } # no toplevel
- .reject{|c| c[:name] == 'DropdownInputWidget' } # different PHP and JS implementations
+ .reject{|c| %w[DropdownInputWidget RadioSelectInputWidget].include? c[:name] } # different PHP and JS implementations
# values to test for each type
expandos = {
@@ -31,10 +31,13 @@ else
# values to test for names
sensible_values = {
'href' => ['http://example.com/'],
- ['TextInputWidget', 'type'] => %w[text password],
- ['ButtonInputWidget', 'type'] => %w[button input],
+ ['TextInputWidget', 'type'] => %w[text password foo],
+ ['ButtonInputWidget', 'type'] => %w[button submit foo],
['FieldLayout', 'help'] => true, # different PHP and JS implementations
+ ['ActionFieldLayout', 'help'] => true, # different PHP and JS implementations
['FieldsetLayout', 'help'] => true, # different PHP and JS implementations
+ ['FieldLayout', 'errors'] => expandos['string'].map{|v| [v] }, # treat as string[]
+ ['FieldLayout', 'notices'] => expandos['string'].map{|v| [v] }, # treat as string[]
'type' => %w[text button],
'method' => %w[GET POST],
'action' => [],
@@ -44,6 +47,7 @@ else
'name' => true,
'autofocus' => true, # usually makes no sense in JS
'tabIndex' => [-1, 0, 100],
+ 'maxLength' => [100],
'icon' => ['picture'],
'indicator' => ['down'],
'flags' => %w[constructive],
@@ -140,7 +144,9 @@ else
end
end
+ $stderr.puts "Generated #{tests.length} test cases."
tests = tests.group_by{|t| t[:class] }
+ $stderr.puts tests.map{|class_name, class_tests| "* #{class_name}: #{class_tests.length}" }
puts JSON.pretty_generate tests
end