()
| 1261 | |
| 1262 | it('should set a value on a submit input', async () => { |
| 1263 | const stub = <input type="submit" value="banana" />; |
| 1264 | await act(() => { |
| 1265 | root.render(stub); |
| 1266 | }); |
| 1267 | const node = container.firstChild; |
| 1268 | |
| 1269 | expect(node.getAttribute('value')).toBe('banana'); |
| 1270 | }); |
| 1271 | |
| 1272 | it('should not set an undefined value on a submit input', async () => { |
| 1273 | const stub = <input type="submit" value={undefined} />; |
| 1274 | await act(() => { |
| 1275 | root.render(stub); |
| 1276 | }); |
| 1277 | const node = container.firstChild; |
| 1278 | |
| 1279 | // Note: it shouldn't be an empty string |
| 1280 | // because that would erase the "submit" label. |
| 1281 | expect(node.getAttribute('value')).toBe(null); |
| 1282 | |
| 1283 | await act(() => { |
| 1284 | root.render(stub); |
| 1285 | }); |
| 1286 | expect(node.getAttribute('value')).toBe(null); |
| 1287 | }); |
| 1288 | |
| 1289 | it('should not set an undefined value on a reset input', async () => { |
| 1290 | const stub = <input type="reset" value={undefined} />; |
nothing calls this directly
no test coverage detected