(t *testing.T)
| 441 | } |
| 442 | |
| 443 | func TestFileFieldValidateSettings(t *testing.T) { |
| 444 | testDefaultFieldIdValidation(t, core.FieldTypeFile) |
| 445 | testDefaultFieldNameValidation(t, core.FieldTypeFile) |
| 446 | testDefaultFieldHelpValidation[core.FileField](t) |
| 447 | |
| 448 | app, _ := tests.NewTestApp() |
| 449 | defer app.Cleanup() |
| 450 | |
| 451 | scenarios := []struct { |
| 452 | name string |
| 453 | field func() *core.FileField |
| 454 | expectErrors []string |
| 455 | }{ |
| 456 | { |
| 457 | "zero minimal", |
| 458 | func() *core.FileField { |
| 459 | return &core.FileField{ |
| 460 | Id: "test", |
| 461 | Name: "test", |
| 462 | } |
| 463 | }, |
| 464 | []string{}, |
| 465 | }, |
| 466 | { |
| 467 | "0x0 thumb", |
| 468 | func() *core.FileField { |
| 469 | return &core.FileField{ |
| 470 | Id: "test", |
| 471 | Name: "test", |
| 472 | MaxSelect: 1, |
| 473 | Thumbs: []string{"100x200", "0x0"}, |
| 474 | } |
| 475 | }, |
| 476 | []string{"thumbs"}, |
| 477 | }, |
| 478 | { |
| 479 | "0x0t thumb", |
| 480 | func() *core.FileField { |
| 481 | return &core.FileField{ |
| 482 | Id: "test", |
| 483 | Name: "test", |
| 484 | MaxSize: 1, |
| 485 | MaxSelect: 1, |
| 486 | Thumbs: []string{"100x200", "0x0t"}, |
| 487 | } |
| 488 | }, |
| 489 | []string{"thumbs"}, |
| 490 | }, |
| 491 | { |
| 492 | "0x0b thumb", |
| 493 | func() *core.FileField { |
| 494 | return &core.FileField{ |
| 495 | Id: "test", |
| 496 | Name: "test", |
| 497 | MaxSize: 1, |
| 498 | MaxSelect: 1, |
| 499 | Thumbs: []string{"100x200", "0x0b"}, |
| 500 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…