714
715
expectDev(console.error.calls.count()).toBe(1);
716
expectDev(console.error.calls.argsFor(0)[0]).toContain(
717
- 'Received a `function` for string attribute `is`. If this is expected, cast ' +
717
+ 'Received a `function` for a string attribute `is`. If this is expected, cast ' +
718
'the value to a string.',
719
);
720
});
2042
expect(el.hasAttribute('whatever')).toBe(false);
2043
2044
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2045
- 'Warning: Received `true` for non-boolean attribute `whatever`',
2045
+ 'Received `true` for a non-boolean attribute `whatever`.\n\n' +
2046
+ 'If you want to write it to the DOM, pass a string instead: ' +
2047
+ 'whatever="true" or whatever={value.toString()}.',
2048
);
2049
});
2050
2057
expect(el.hasAttribute('whatever')).toBe(false);
2058
2059
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2058
- 'Warning: Received `true` for non-boolean attribute `whatever`',
2060
+ 'Received `true` for a non-boolean attribute `whatever`.\n\n' +
2061
+ 'If you want to write it to the DOM, pass a string instead: ' +
2062
+ 'whatever="true" or whatever={value.toString()}.',
2063
);
2064
});
2065
2132
expect(el.getAttribute('whatever')).toBe('NaN');
2133
2134
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2131
- 'Warning: Received NaN for numeric attribute `whatever`. If this is ' +
2135
+ 'Warning: Received NaN for the `whatever` attribute. If this is ' +
2136
'expected, cast the value to a string.\n in div',
2137
);
2138
});
2234
expect(el.hasAttribute('whatever')).toBe(false);
2235
2236
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2233
- 'Warning: Received `true` for non-boolean attribute `whatever`.',
2237
+ 'Received `true` for a non-boolean attribute `whatever`.\n\n' +
2238
+ 'If you want to write it to the DOM, pass a string instead: ' +
2239
+ 'whatever="true" or whatever={value.toString()}.',
2240
);
2241
});
2242
2289
2290
expectDev(console.error.calls.count()).toBe(1);
2291
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2286
- 'Warning: Received `false` for non-boolean attribute `whatever`.',
2292
+ 'Received `false` for a non-boolean attribute `whatever`.\n\n' +
2293
+ 'If you want to write it to the DOM, pass a string instead: ' +
2294
+ 'whatever="false" or whatever={value.toString()}.\n\n' +
2295
+ 'If you used to conditionally omit it with whatever={condition && value}, ' +
2296
+ 'pass whatever={condition ? value : undefined} instead.',
2297
);
2298
});
2299
});