(t *testing.T)
| 131 | } |
| 132 | |
| 133 | func TestDateFieldValidateSettings(t *testing.T) { |
| 134 | testDefaultFieldIdValidation(t, core.FieldTypeDate) |
| 135 | testDefaultFieldNameValidation(t, core.FieldTypeDate) |
| 136 | testDefaultFieldHelpValidation[core.DateField](t) |
| 137 | |
| 138 | app, _ := tests.NewTestApp() |
| 139 | defer app.Cleanup() |
| 140 | |
| 141 | collection := core.NewBaseCollection("test_collection") |
| 142 | |
| 143 | scenarios := []struct { |
| 144 | name string |
| 145 | field func() *core.DateField |
| 146 | expectErrors []string |
| 147 | }{ |
| 148 | { |
| 149 | "zero Min/Max", |
| 150 | func() *core.DateField { |
| 151 | return &core.DateField{ |
| 152 | Id: "test", |
| 153 | Name: "test", |
| 154 | } |
| 155 | }, |
| 156 | []string{}, |
| 157 | }, |
| 158 | { |
| 159 | "non-empty Min with empty Max", |
| 160 | func() *core.DateField { |
| 161 | return &core.DateField{ |
| 162 | Id: "test", |
| 163 | Name: "test", |
| 164 | Min: types.NowDateTime(), |
| 165 | } |
| 166 | }, |
| 167 | []string{}, |
| 168 | }, |
| 169 | { |
| 170 | "empty Min non-empty Max", |
| 171 | func() *core.DateField { |
| 172 | return &core.DateField{ |
| 173 | Id: "test", |
| 174 | Name: "test", |
| 175 | Max: types.NowDateTime(), |
| 176 | } |
| 177 | }, |
| 178 | []string{}, |
| 179 | }, |
| 180 | { |
| 181 | "Min = Max", |
| 182 | func() *core.DateField { |
| 183 | date := types.NowDateTime() |
| 184 | return &core.DateField{ |
| 185 | Id: "test", |
| 186 | Name: "test", |
| 187 | Min: date, |
| 188 | Max: date, |
| 189 | } |
| 190 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…