Test/DropDown: Difference between revisions
No edit summary Tag: Reverted |
m Text replacement - "datatable2" to "riskdata" |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <riskdata table="dropdowntest1" columns="method|effectiveness" class="wikitable"> | ||
<head> | <head> | ||
|- | |- | ||
Line 11: | Line 11: | ||
IUD|99.9 | IUD|99.9 | ||
Tubal Ligation|99.99 | Tubal Ligation|99.99 | ||
</ | </riskdata> | ||
<DropDown title="Method" table=" | <DropDown title="Method" table="dropdowntest1"></DropDown> | ||
< | <riskdata table="dropdowntest2" columns="choice" class="wikitable"> | ||
<head> | <head> | ||
|- | |- | ||
Line 23: | Line 23: | ||
Second | Second | ||
Third | Third | ||
</ | </riskdata> | ||
<DropDown title="Choose One" table=" | <DropDown title="Choose One" table="dropdowntest2"></DropDown> | ||
Testing selecting using different columns from the table: | Testing selecting using different columns from the table: | ||
< | <riskdata table="dropdowntest3" columns="l1|v1|l2|v2|l3|v3" class="wikitable"> | ||
<head> | <head> | ||
|- | |- | ||
Line 42: | Line 42: | ||
1_Two|2|2_Two|101|3_Two|1003 | 1_Two|2|2_Two|101|3_Two|1003 | ||
1_Three|3|2_Three|102|3_Three|1003 | 1_Three|3|2_Three|102|3_Three|1003 | ||
</ | </riskdata> | ||
<DropDown title="One's column" table=" | <DropDown title="One's column" table="dropdowntest3"></DropDown> | ||
<DropDown title="Two's column" table=" | <DropDown title="Two's column" table="dropdowntest3" label_column=l2 value_column=v2></DropDown> | ||
<DropDown title="Three's column" table= | <DropDown title="Three's column" table=dropdowntest3 label_column=l3 value_column=v3></DropDown> | ||
Test some error conditions: | Test some error conditions: | ||
No | No riskdata name given: <DropDown title=NoTable></DropDown> | ||
Non-exisistent table: <DropDown title="NoSuch" table=" | Non-exisistent table: <DropDown title="NoSuch" table="nosuchtable"></DropDown> | ||
Bad column names: <DropDown title="Oopsie column" table=" | Bad column names: <DropDown title="Oopsie column" table="dropdowntest3" label_column=typo value_column=v2></DropDown> | ||
<DropDown title="Oopsie column" table= | <DropDown title="Oopsie column" table=dropdowntest3 label_column=l2 value_column=oopsie></DropDown> |
Latest revision as of 17:34, 12 September 2025
method | effectiveness |
---|---|
None |
0 |
Rhythm |
90 |
Condom |
95 |
IUD |
99.9 |
Tubal Ligation |
99.99 |
[{"method":"None","effectiveness":"0"},{"method":"Rhythm","effectiveness":"90"},{"method":"Condom","effectiveness":"95"},{"method":"IUD","effectiveness":"99.9"},{"method":"Tubal Ligation","effectiveness":"99.99"}]
choice |
---|
First |
Second |
Third |
[{"choice":"First"},{"choice":"Second"},{"choice":"Third"}]
Testing selecting using different columns from the table:
l1 | v1 | l2 | v2 | l3 | v3 |
---|---|---|---|---|---|
1_One |
1 |
2_One |
100 |
3_One |
1000 |
1_Two |
2 |
2_Two |
101 |
3_Two |
1003 |
1_Three |
3 |
2_Three |
102 |
3_Three |
1003 |
[{"l1":"1_One","v1":"1","l2":"2_One","v2":"100","l3":"3_One","v3":"1000"},{"l1":"1_Two","v1":"2","l2":"2_Two","v2":"101","l3":"3_Two","v3":"1003"},{"l1":"1_Three","v1":"3","l2":"2_Three","v2":"102","l3":"3_Three","v3":"1003"}]
[{"l2":"2_One","l1":"1_One","v1":"1","v2":"100","l3":"3_One","v3":"1000"},{"l2":"2_Two","l1":"1_Two","v1":"2","v2":"101","l3":"3_Two","v3":"1003"},{"l2":"2_Three","l1":"1_Three","v1":"3","v2":"102","l3":"3_Three","v3":"1003"}]
[{"l3":"3_One","l1":"1_One","v1":"1","l2":"2_One","v2":"100","v3":"1000"},{"l3":"3_Two","l1":"1_Two","v1":"2","l2":"2_Two","v2":"101","v3":"1003"},{"l3":"3_Three","l1":"1_Three","v1":"3","l2":"2_Three","v2":"102","v3":"1003"}]
Test some error conditions:
No riskdata name given: dropdown: missing table attribute
Non-exisistent table: dropdown: cannot find RiskData table nosuchtable
Bad column names: dropdown: no column named typo (valid columns are: l1 v1 l2 v2 l3 v3)
[{"l2":"2_One","l1":"1_One","v1":"1","v2":"100","l3":"3_One","v3":"1000"},{"l2":"2_Two","l1":"1_Two","v1":"2","v2":"101","l3":"3_Two","v3":"1003"},{"l2":"2_Three","l1":"1_Three","v1":"3","v2":"102","l3":"3_Three","v3":"1003"}]