Skip to content

Commit 2a2202a

Browse files
authored
Changed and removed incorrect tests (#28)
1 parent 6f897fb commit 2a2202a

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

__tests__/suits/Area.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ describe('test ValidatorProvider', () => {
357357
<ValidatorArea rules="required">
358358
{({valid}) => (
359359
<>
360-
<input name="test" value=""/>
360+
<input name="test" value="test" />
361361
<div>{valid ? 'yes' : 'no'}</div>
362362
</>
363363
)}
@@ -366,7 +366,7 @@ describe('test ValidatorProvider', () => {
366366

367367
area.find('input').at(0).simulate('blur');
368368
await tick();
369-
expect(area.find('div').text()).toBe('no');
369+
expect(area.find('div').text()).toBe('yes');
370370
});
371371

372372
it('should indicate pending while validation is ongoing', async () => {
@@ -411,7 +411,7 @@ describe('test ValidatorProvider', () => {
411411

412412
it('should indicate touched when input blurred', async () => {
413413
const area = mount(
414-
<ValidatorArea rules="long_wait">
414+
<ValidatorArea rules="required">
415415
{({touched}) => (
416416
<>
417417
<input name="test" value=""/>

__tests__/suits/Provider.test.tsx

-20
Original file line numberDiff line numberDiff line change
@@ -142,24 +142,4 @@ describe('test ValidatorProvider', () => {
142142
await tick();
143143
expect(mockFn).toHaveBeenCalled()
144144
});
145-
146-
it('should indicate whether the area is dirty', async () => {
147-
const provider = mount<ValidatorProvider, ValidatorProviderProps>(
148-
<ValidatorProvider>
149-
{({ dirty }) => (
150-
<>
151-
<ValidatorArea name="test1" rules="required">
152-
<input value="1" />
153-
</ValidatorArea>
154-
<div>{dirty ? 'yes' : 'no'}</div>
155-
</>
156-
)}
157-
</ValidatorProvider>
158-
);
159-
160-
provider.find('input').at(0).simulate('blur');
161-
await tick();
162-
expect(provider.find('div').text()).toBe('no');
163-
164-
})
165145
})

0 commit comments

Comments
 (0)