(t *testing.T)
| 326 | } |
| 327 | |
| 328 | func TestGenElementsIntProperties(t *testing.T) { |
| 329 | t.Parallel() |
| 330 | rt := getTestRuntimeWithDoc(t, testGenElems) |
| 331 | |
| 332 | intTests := []struct { |
| 333 | id string |
| 334 | property string |
| 335 | data int |
| 336 | }{ |
| 337 | {"img1", "width", 100}, |
| 338 | {"img1", "height", 50}, |
| 339 | {"input7", "maxLength", 10}, |
| 340 | {"input7", "size", 5}, |
| 341 | {"li1", "value", 0}, |
| 342 | {"li2", "value", 10}, |
| 343 | {"meter1", "min", 90}, |
| 344 | {"meter1", "max", 110}, |
| 345 | {"meter1", "low", 95}, |
| 346 | {"meter1", "high", 105}, |
| 347 | {"meter1", "optimum", 100}, |
| 348 | {"object1", "tabIndex", 6}, |
| 349 | {"ol1", "start", 1}, |
| 350 | {"td1", "colSpan", 2}, |
| 351 | {"td1", "rowSpan", 3}, |
| 352 | {"th1", "colSpan", 1}, |
| 353 | {"th1", "colSpan", 1}, |
| 354 | {"txtarea1", "rows", 10}, |
| 355 | {"txtarea1", "cols", 12}, |
| 356 | {"txtarea1", "maxLength", 128}, |
| 357 | {"txtarea1", "tabIndex", 4}, |
| 358 | } |
| 359 | for _, test := range intTests { |
| 360 | v, err := rt.RunString(`doc.find("#` + test.id + `").get(0).` + test.property + `()`) |
| 361 | if err != nil { |
| 362 | t.Errorf("Error for property name '%s' on element id '#%s':\n%+v", test.property, test.id, err) |
| 363 | } else if v.Export() != int64(test.data) { |
| 364 | t.Errorf("Expected %d for property name '%s' on element id '#%s'. Got %d", test.data, test.property, test.id, v.ToInteger()) |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | func TestGenElementsNullProperties(t *testing.T) { |
| 370 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…