Skip to content

Commit

Permalink
test: modify test
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Sep 5, 2024
1 parent a9314a3 commit 97d82df
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
34 changes: 17 additions & 17 deletions packages/rax-compat/tests/events.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,82 +37,82 @@ describe('events', () => {
});

it('should work with ontouchstart', () => {
expect(transformProps({
expect(transformProps('div', {
ontouchstart: () => { },
}).onTouchStart).toBeInstanceOf(Function);
});

it('should work with onclick', () => {
expect(transformProps({
expect(transformProps('div', {
onclick: () => { },
}).onClick).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onclick: () => { },
}).onclick).toBe(undefined);
});

it('should work with onClick', () => {
expect(transformProps({
expect(transformProps('div', {
onClick: () => { },
}).onClick).toBeInstanceOf(Function);
});

it('should work with ondblclick', () => {
expect(transformProps({
expect(transformProps('div', {
ondblclick: () => { },
}).onDoubleClick).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
ondblclick: () => { },
}).ondblclick).toBe(undefined);
});

it('should work with onDblclick', () => {
expect(transformProps({
expect(transformProps('div', {
onDblclick: () => { },
}).onDoubleClick).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onDblclick: () => { },
}).onDblclick).toBe(undefined);
});

it('should work with onDoubleClick', () => {
expect(transformProps({
expect(transformProps('div', {
onDoubleClick: () => { },
}).onDoubleClick).toBeInstanceOf(Function);
});

it('should work with onmouseenter', () => {
expect(transformProps({
expect(transformProps('div', {
onmouseenter: () => { },
}).onMouseEnter).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onmouseenter: () => { },
}).onmouseenter).toBe(undefined);
});

it('should work with onpointerenter', () => {
expect(transformProps({
expect(transformProps('div', {
onpointerenter: () => { },
}).onPointerEnter).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onpointerenter: () => { },
}).onpointerenter).toBe(undefined);
});

it('should work with onchange', () => {
expect(transformProps({
expect(transformProps('div', {
onchange: () => { },
}).onChange).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onchange: () => { },
}).onchange).toBe(undefined);
});

it('should work with onbeforeinput', () => {
expect(transformProps({
expect(transformProps('div', {
onbeforeinput: () => { },
}).onBeforeInput).toBeInstanceOf(Function);
expect(transformProps({
expect(transformProps('div', {
onbeforeinput: () => { },
}).onbeforeinput).toBe(undefined);
});
Expand Down
14 changes: 7 additions & 7 deletions packages/rax-compat/tests/props.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,44 @@ import transformProps from '../src/props';

describe('props', () => {
it('should work with autofocus', () => {
expect(transformProps({
expect(transformProps('div', {
autofocus: true,
}).autoFocus).toBe(true);
});

it('should work with autoplay', () => {
expect(transformProps({
expect(transformProps('div', {
autoplay: true,
}).autoPlay).toBe(true);
});

it('should work with classname', () => {
expect(transformProps({
expect(transformProps('div', {
classname: 'class',
}).className).toBe('class');
});

it('should work with crossorigin', () => {
expect(transformProps({
expect(transformProps('div', {
crossorigin: 'xxx',
}).crossOrigin).toBe('xxx');
});

it('should work with maxlength', () => {
expect(transformProps({
expect(transformProps('div', {
maxlength: '10',
}).maxLength).toBe('10');
});

it('should work with inputmode', () => {
expect(transformProps({
expect(transformProps('div', {
inputmode: 'numeric',
}).inputMode).toBe('numeric');
});

it('should work with dangerouslySetInnerHTML', () => {
expect(
transformProps({
transformProps('div', {
dangerouslySetInnerHTML: { __html: 'xxx' },
}).dangerouslySetInnerHTML,
).toEqual({
Expand Down

0 comments on commit 97d82df

Please sign in to comment.