Skip to content

2.1.2 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions __tests__/suits/Area.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import { mount } from 'enzyme';
import { Validator } from '@/Validator';
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
import ValidatorProvider, { ValidatorProviderProps } from '@/components/ValidatorProvider';
import { ProviderScope } from '@/ProviderScope';
import required from '@/rules/required';
import {
ValidatorArea,
ValidatorAreaProps,
Validator,
ValidatorProvider,
ValidatorProviderProps,
ProviderScope,
required
} from '../../src';
import tick from '../common/tick';

describe('test ValidatorProvider', () => {
Expand Down
9 changes: 6 additions & 3 deletions __tests__/suits/Provider.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import { mount } from 'enzyme';
import { Validator } from '@/Validator';
import ValidatorProvider, { ValidatorProviderProps } from '@/components/ValidatorProvider';
import { ValidatorArea } from '@/components/ValidatorArea';
import {
Validator,
ValidatorProvider,
ValidatorProviderProps,
ValidatorArea
} from '../../src';
import tick from '../common/tick';

describe('test ValidatorProvider', () => {
Expand Down
3 changes: 1 addition & 2 deletions __tests__/suits/Validator.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Rule } from '@/Rule';
import { Validator } from '@/Validator';
import { Validator, Rule } from '../../src';

describe('test validator', () => {
beforeEach(() => {
Expand Down
6 changes: 4 additions & 2 deletions __tests__/suits/rules/activeUrl.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Validator } from '@/Validator';
import activeUrl from '@/rules/activeUrl';
import {
Validator,
activeUrl
} from '../../../src';
import fetchMock from 'jest-fetch-mock';

describe('test activeUrl rule', () => {
Expand Down
6 changes: 4 additions & 2 deletions __tests__/suits/rules/checked.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Validator } from '@/Validator';
import checked from '@/rules/checked';
import {
Validator,
checked
} from '../../../src';

describe('test checked rule', (): void => {
beforeEach((): void => {
Expand Down
11 changes: 7 additions & 4 deletions __tests__/suits/rules/max.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import { mount } from 'enzyme';
import max from '@/rules/max';
import { Validator } from '@/Validator';
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
import {
Validator,
ValidatorArea,
ValidatorAreaProps,
IncorrectArgumentTypeError,
max
} from '../../../src';
import tick from '../../common/tick';
import { IncorrectArgumentTypeError } from '@/rules';

describe('test max rule', () => {
beforeEach(() => {
Expand Down
13 changes: 8 additions & 5 deletions __tests__/suits/rules/min.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import min from '@/rules/min';
import { Validator } from '@/Validator';
import { mount } from 'enzyme';
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
import React from 'react';
import { mount } from 'enzyme';
import {
min,
Validator,
ValidatorArea,
IncorrectArgumentTypeError,
ValidatorAreaProps
} from '../../../src';
import tick from '../../common/tick';
import { IncorrectArgumentTypeError } from '@/rules';

describe('test min rule', () => {
beforeEach(() => {
Expand Down
9 changes: 6 additions & 3 deletions __tests__/suits/rules/regex.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Validator } from '@/Validator';
import { mount } from 'enzyme';
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
import React from 'react';
import regex from '@/rules/regex';
import {
Validator,
ValidatorArea,
ValidatorAreaProps,
regex
} from '../../../src';
import tick from '../../common/tick';

describe('test regex rule', () => {
Expand Down
9 changes: 6 additions & 3 deletions __tests__/suits/rules/required.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import { mount } from 'enzyme';
import required from '@/rules/required';
import { ValidatorAreaProps, ValidatorArea } from '@/components/ValidatorArea';
import { Validator } from '@/Validator';
import {
required,
ValidatorAreaProps,
ValidatorArea,
Validator
} from '../../../src';
import tick from '../../common/tick';

describe('test required rule', () => {
Expand Down
7 changes: 6 additions & 1 deletion __tests__/suits/utils/dom.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { getValue, htmlCollectionToArray, isInputElement, isSelectElement } from '@/common/dom';
import {
getValue,
htmlCollectionToArray,
isInputElement,
isSelectElement
} from '../../../src/common/dom';

describe('dom helpers test', () => {
it('should convert HtmlCollection to array', () => {
Expand Down
5 changes: 1 addition & 4 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"testRegex": "(/__tests__/suits/|(\\.|/)(test|spec))\\.[jt]sx?$",
"setupFilesAfterEnv": ["./setupTests.ts"],
"moduleNameMapper": {
"@/(.*)": "<rootDir>/src/$1"
}
"setupFilesAfterEnv": ["./setupTests.ts"]
}
Loading