Skip to content
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
227 changes: 227 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
name: Bulk Run Tests

on:
pull_request:
types: [labeled, synchronize]

jobs:
bulk-run-tests-1:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-2:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-3:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-4:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-5:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-6:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-7:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-8:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-9:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
bulk-run-tests-10:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install & build
run: |
npm install
npm run bootstrap
- name: test 1
run: |
npm run test
- name: test 2
run: |
npm run test
56 changes: 30 additions & 26 deletions packages/antd/src/hooks/fields/useCheckboxGroup/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { checkboxGroupProps } = result.current;
const { options } = checkboxGroupProps;

expect(options).toHaveLength(2);
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toHaveLength(2),
);

expect(options).toEqual([
{
label: "Necessitatibus necessitatibus id et cupiditate provident est qui amet.",
value: "1",
},
{ label: "Recusandae consectetur aut atque est.", value: "2" },
]);
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toEqual([
{
label: "Necessitatibus necessitatibus id et cupiditate provident est qui amet.",
value: "1",
},
{ label: "Recusandae consectetur aut atque est.", value: "2" },
]),
);
});

it("should success data with resource with optionLabel and optionValue", async () => {
Expand All @@ -51,14 +52,16 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { checkboxGroupProps } = result.current;
const { options } = checkboxGroupProps;
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toHaveLength(2),
);

expect(options).toHaveLength(2);
expect(options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]);
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]),
);
});

it("should invoke queryOptions methods successfully", async () => {
Expand All @@ -85,14 +88,15 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { checkboxGroupProps } = result.current;
const { options } = checkboxGroupProps;

expect(options).toHaveLength(2);
expect(options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]);
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toHaveLength(2),
);
await waitFor(() =>
expect(result.current.checkboxGroupProps.options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]),
);

expect(mockFunc).toBeCalled();
});
Expand Down
57 changes: 30 additions & 27 deletions packages/antd/src/hooks/fields/useRadioGroup/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { radioGroupProps } = result.current;
const { options } = radioGroupProps;

expect(options).toHaveLength(2);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toHaveLength(2),
);

expect(options).toEqual([
{
label: "Necessitatibus necessitatibus id et cupiditate provident est qui amet.",
value: "1",
},
{ label: "Recusandae consectetur aut atque est.", value: "2" },
]);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toEqual([
{
label: "Necessitatibus necessitatibus id et cupiditate provident est qui amet.",
value: "1",
},
{ label: "Recusandae consectetur aut atque est.", value: "2" },
]),
);
});

it("should success data with resource with optionLabel and optionValue", async () => {
Expand All @@ -51,14 +52,15 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { radioGroupProps } = result.current;
const { options } = radioGroupProps;

expect(options).toHaveLength(2);
expect(options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toHaveLength(2),
);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]),
);
});

it("should invoke queryOptions methods successfully", async () => {
Expand All @@ -85,14 +87,15 @@ describe("render hook default options", () => {
expect(result.current.queryResult.isSuccess).toBeTruthy();
});

const { radioGroupProps } = result.current;
const { options } = radioGroupProps;

expect(options).toHaveLength(2);
expect(options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toHaveLength(2),
);
await waitFor(() =>
expect(result.current.radioGroupProps.options).toEqual([
{ label: "ut-ad-et", value: "1" },
{ label: "consequatur-molestiae-rerum", value: "2" },
]),
);

expect(mockFunc).toBeCalled();
});
Expand Down
Loading