mirror of
				https://github.com/vuejs/babel-plugin-jsx.git
				synced 2025-11-04 03:12:20 +08:00 
			
		
		
		
	chore: remove deprecated test file
This commit is contained in:
		@@ -1,42 +0,0 @@
 | 
			
		||||
import { createMountedApp } from './util';
 | 
			
		||||
 | 
			
		||||
test('Spread (single object expression)', () => {
 | 
			
		||||
  const props = {
 | 
			
		||||
    innerHTML: 123,
 | 
			
		||||
    other: '1',
 | 
			
		||||
  };
 | 
			
		||||
  const { node, dom } = createMountedApp({ render: () => <div {...props}></div> });
 | 
			
		||||
  expect(dom.innerHTML).toBe('<div other="1">123</div>');
 | 
			
		||||
  expect(node.props.other).toBe('1');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('Spread (mixed)', () => {
 | 
			
		||||
  const calls = [];
 | 
			
		||||
  const data = {
 | 
			
		||||
    id: 'hehe',
 | 
			
		||||
    onClick() {
 | 
			
		||||
      calls.push(3);
 | 
			
		||||
    },
 | 
			
		||||
    innerHTML: 2,
 | 
			
		||||
    class: ['a', 'b'],
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const { node, dom } = createMountedApp({
 | 
			
		||||
    setup: () => () => (
 | 
			
		||||
      <div
 | 
			
		||||
        href="huhu"
 | 
			
		||||
        {...data}
 | 
			
		||||
        class={{ c: true }}
 | 
			
		||||
        on-click={() => calls.push(4)}
 | 
			
		||||
        hook-insert={() => calls.push(2)}
 | 
			
		||||
      />
 | 
			
		||||
    ),
 | 
			
		||||
  });
 | 
			
		||||
  expect(node.props.id).toBe('hehe');
 | 
			
		||||
  expect(node.props.href).toBe('huhu');
 | 
			
		||||
  expect(node.props.class).toBe(['a', 'b', { c: true }]);
 | 
			
		||||
  expect(node.props.innerHTML).toBe('2');
 | 
			
		||||
  expect(calls).toBe([1, 2]);
 | 
			
		||||
  dom.click();
 | 
			
		||||
  expect(calls).toBe([1, 2, 3, 4]);
 | 
			
		||||
});
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
import { createApp } from 'vue';
 | 
			
		||||
 | 
			
		||||
export const createMountedApp = function (compoent) {
 | 
			
		||||
  const dom = document.createElement('div');
 | 
			
		||||
  const App = createApp(compoent).mount(dom);
 | 
			
		||||
  return { App, dom, node: App.$.subTree };
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user