mirror of https://github.com/sveltejs/svelte
20 lines
530 B
20 lines
530 B
// TODO gah, JSDOM appears to behave differently to real browsers here... probably need to raise an issue
|
|
|
|
export default {
|
|
html: '<input><!--#if visible-->',
|
|
test ( assert, component ) {
|
|
component.refs.input.focus();
|
|
|
|
// this should NOT trigger blur event
|
|
component.set({ visible: false });
|
|
assert.ok( !component.get( 'blurred' ) );
|
|
|
|
component.set({ visible: true });
|
|
component.refs.input.focus();
|
|
|
|
// this SHOULD trigger blur event
|
|
component.refs.input.blur();
|
|
assert.ok( component.get( 'blurred' ) );
|
|
}
|
|
};
|