Merge pull request #7366 from 2betop/chore-update-snaphost

chore: 调整 snapshot 比对忽略 aria-labelledby
This commit is contained in:
hsm-lv 2023-07-05 16:00:37 +08:00 committed by GitHub
commit d8850b8035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 138 additions and 850 deletions

View File

@ -96,28 +96,18 @@ export function formatStyleObject(style: string | null, px2number = true) {
* @param container The HTMLElement node to search for SSR ids
*/
export function replaceReactAriaIds(container: HTMLElement) {
const selectors = ['id', 'for', 'aria-labelledby'];
const ariaSelector = (el: string) => `[${el}^="react-aria"]`;
const regexp = /react-aria\d+-\d+/g;
const staticId = 'static-id';
/**
* keep a map of the replaceIds to keep the matching between input "id" and label "for" attributes
*/
const attributesMap: Record<string, string> = {};
const selectors = ['aria-labelledby'];
const ariaSelector = (el: string) => `[${el}]`;
const regexp = /downshift\-\d+-label/g;
container
.querySelectorAll(selectors.map(ariaSelector).join(', '))
.forEach((el, index) => {
.forEach(el => {
selectors.forEach(selector => {
const attr = el.getAttribute(selector);
if (attr?.match(regexp)) {
const newAttr = `${staticId}-${index}`;
el.setAttribute(selector, attributesMap[attr] || newAttr);
attributesMap[attr] = newAttr;
el.removeAttribute(selector);
}
});
});

View File

@ -27,7 +27,7 @@ import {
} from '@testing-library/react';
import '../../src';
import {clearStoresCache, render as amisRender} from '../../src';
import {makeEnv as makeEnvRaw, wait} from '../helper';
import {makeEnv as makeEnvRaw, replaceReactAriaIds, wait} from '../helper';
import rows from '../mockData/rows';
import type {RenderOptions} from '../../src';
@ -106,11 +106,13 @@ test('Renderer:crud basic interval headerToolbar footerToolbar', async () => {
makeEnv({fetcher: mockFetcher})
)
);
replaceReactAriaIds(container);
await waitFor(() => {
expect(container.querySelectorAll('tbody>tr').length > 5).toBeTruthy();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
await wait(1001);
@ -274,6 +276,7 @@ test('Renderer:crud list', async () => {
await waitFor(() => {
expect(container.querySelectorAll('.cxd-ListItem').length > 5).toBeTruthy();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -316,6 +319,7 @@ test('Renderer:crud cards', async () => {
await waitFor(() => {
expect(container.querySelector('.cxd-Card-title')).toBeInTheDocument();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -351,6 +355,7 @@ test('Renderer:crud source & alwaysShowPagination', async () => {
makeEnv({})
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -690,7 +695,8 @@ test('Renderer: crud sortable & orderBy & orderDir & orderField', async () => {
page: 1,
perPage: 10
});
expect(container).toMatchSnapshot();
// replaceReactAriaIds(container);
// expect(container).toMatchSnapshot();
});
test('Renderer: crud keepItemSelectionOnPageChange & maxKeepItemSelectionLength & labelTpl', async () => {
@ -742,6 +748,7 @@ test('Renderer: crud keepItemSelectionOnPageChange & maxKeepItemSelectionLength
container.querySelectorAll('.cxd-Crud-selection>.cxd-Crud-value').length
).toBe(4);
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -187,7 +187,6 @@ exports[`Renderer:chained-select 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select cxd-Select--inline"
role="combobox"
tabindex="0"
@ -213,7 +212,6 @@ exports[`Renderer:chained-select 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
class="cxd-Select cxd-Select--inline"
role="combobox"
tabindex="0"
@ -239,7 +237,6 @@ exports[`Renderer:chained-select 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-2-label"
class="cxd-Select cxd-Select--inline"
role="combobox"
tabindex="0"
@ -265,7 +262,6 @@ exports[`Renderer:chained-select 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-3-label"
class="cxd-Select cxd-Select--inline"
role="combobox"
tabindex="0"

View File

@ -948,7 +948,6 @@ exports[`Renderer:combo with conditions: add button open 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-6-label"
class="cxd-Select"
role="combobox"
tabindex="0"
@ -1333,7 +1332,6 @@ exports[`Renderer:combo with draggable 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-4-label"
class="cxd-Select"
role="combobox"
tabindex="0"
@ -1450,7 +1448,6 @@ exports[`Renderer:combo with draggable 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-5-label"
class="cxd-Select"
role="combobox"
tabindex="0"

View File

@ -75,7 +75,6 @@ exports[`Renderer:condition-builder 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select"
role="combobox"
tabindex="0"

View File

@ -55,7 +55,6 @@ exports[`Renderer:icon-picker 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-IconPickerControl-input cxd-IconPickerControl-input--withAC"
role="combobox"
>
@ -72,7 +71,6 @@ exports[`Renderer:icon-picker 1`] = `
</div>
<input
aria-autocomplete="list"
aria-labelledby="downshift-0-label"
autocomplete="off"
id="downshift-0-input"
name="a"

View File

@ -71,7 +71,6 @@ exports[`Renderer:inputCity 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select"
role="combobox"
tabindex="0"
@ -105,7 +104,6 @@ exports[`Renderer:inputCity 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
class="cxd-Select"
role="combobox"
tabindex="0"
@ -139,7 +137,6 @@ exports[`Renderer:inputCity 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-2-label"
class="cxd-Select is-focused"
role="combobox"
tabindex="0"
@ -309,7 +306,6 @@ exports[`Renderer:inputCity with searchable: open select 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-3-label"
aria-owns="downshift-3-menu"
class="cxd-Select cxd-Select--searchable is-opened has-popover"
role="combobox"
@ -354,7 +350,6 @@ exports[`Renderer:inputCity with searchable: open select 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-3-menu"
aria-labelledby="downshift-3-label"
autocomplete="off"
id="downshift-3-input"
placeholder="搜索"

View File

@ -923,7 +923,6 @@ exports[`Renderer:input-table cell selects delete 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-4-label"
class="cxd-Select cxd-Select--multi"
role="combobox"
tabindex="0"

View File

@ -30,7 +30,6 @@ exports[`Renderer:InputTag InputTag input with batch tag 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-3-label"
aria-owns="downshift-3-menu"
class="cxd-Form-control cxd-TagControl"
role="combobox"
@ -96,7 +95,6 @@ exports[`Renderer:InputTag InputTag input with batch tag 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-3-menu"
aria-labelledby="downshift-3-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-3-input"
@ -147,7 +145,6 @@ exports[`Renderer:InputTag InputTag input with batch tag and separator "|" 1`] =
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-4-label"
aria-owns="downshift-4-menu"
class="cxd-Form-control cxd-TagControl"
role="combobox"
@ -213,7 +210,6 @@ exports[`Renderer:InputTag InputTag input with batch tag and separator "|" 1`] =
<input
aria-autocomplete="list"
aria-controls="downshift-4-menu"
aria-labelledby="downshift-4-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-4-input"
@ -264,7 +260,6 @@ exports[`Renderer:InputTag InputTag input with max quantity 2 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-5-label"
class="cxd-Form-control cxd-TagControl"
role="combobox"
>
@ -311,7 +306,6 @@ exports[`Renderer:InputTag InputTag input with max quantity 2 1`] = `
</div>
<input
aria-autocomplete="list"
aria-labelledby="downshift-5-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-5-input"
@ -362,7 +356,6 @@ exports[`Renderer:InputTag InputTag input with maxTagLength 5 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-6-label"
class="cxd-Form-control cxd-TagControl"
role="combobox"
>
@ -392,7 +385,6 @@ exports[`Renderer:InputTag InputTag input with maxTagLength 5 1`] = `
</div>
<input
aria-autocomplete="list"
aria-labelledby="downshift-6-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-6-input"
@ -443,7 +435,6 @@ exports[`Renderer:InputTag InputTag input with single tag 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-2-label"
aria-owns="downshift-2-menu"
class="cxd-Form-control cxd-TagControl"
role="combobox"
@ -475,7 +466,6 @@ exports[`Renderer:InputTag InputTag input with single tag 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-2-menu"
aria-labelledby="downshift-2-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-2-input"
@ -526,7 +516,6 @@ exports[`Renderer:InputTag InputTag with options 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-Form-control cxd-TagControl has-popover"
role="combobox"
@ -542,7 +531,6 @@ exports[`Renderer:InputTag InputTag with options 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-labelledby="downshift-1-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-1-input"
@ -720,7 +708,6 @@ exports[`Renderer:InputTag InputTag with placeholder 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Form-control cxd-TagControl"
role="combobox"
>
@ -733,7 +720,6 @@ exports[`Renderer:InputTag InputTag with placeholder 1`] = `
>
<input
aria-autocomplete="list"
aria-labelledby="downshift-0-label"
autocomplete="off"
class="cxd-ResultBox-value-input"
id="downshift-0-input"

View File

@ -1224,7 +1224,6 @@ exports[`Renderer:number with unitOptions 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select cxd-NumberControl-unit"
role="combobox"
tabindex="0"

View File

@ -184,7 +184,6 @@ exports[`Renderer:repeat 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
aria-owns="downshift-0-menu"
class="cxd-Select is-opened pull-right has-popover"
role="combobox"

View File

@ -2058,7 +2058,6 @@ exports[`Renderer:select menutpl 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select"
role="combobox"
tabindex="0"
@ -3391,7 +3390,6 @@ exports[`Renderer:select virtual 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-Select is-opened has-popover"
role="combobox"

View File

@ -60,7 +60,6 @@ exports[`Renderer:service 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select"
role="combobox"
tabindex="0"

View File

@ -2068,13 +2068,11 @@ exports[`Renderer:text with options 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-TextControl-input cxd-TextControl-input--withAC"
role="combobox"
>
<input
aria-autocomplete="list"
aria-labelledby="downshift-0-label"
autocomplete="off"
class=""
id="downshift-0-input"
@ -2202,7 +2200,6 @@ exports[`Renderer:text with options and multiple and delimiter: first option sel
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened cxd-TextControl-input--multiple has-popover"
role="combobox"
@ -2224,7 +2221,6 @@ exports[`Renderer:text with options and multiple and delimiter: first option sel
<input
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-labelledby="downshift-1-label"
autocomplete="off"
class=""
id="downshift-1-input"
@ -2488,7 +2484,6 @@ exports[`Renderer:text with options and multiple and delimiter: options is opene
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened cxd-TextControl-input--multiple has-popover"
role="combobox"
@ -2497,7 +2492,6 @@ exports[`Renderer:text with options and multiple and delimiter: options is opene
<input
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-labelledby="downshift-1-label"
autocomplete="off"
class=""
id="downshift-1-input"
@ -2775,7 +2769,6 @@ exports[`Renderer:text with options and multiple and delimiter: options is opene
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened cxd-TextControl-input--multiple has-popover"
role="combobox"
@ -2797,7 +2790,6 @@ exports[`Renderer:text with options and multiple and delimiter: options is opene
<input
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-labelledby="downshift-1-label"
autocomplete="off"
class=""
id="downshift-1-input"
@ -3061,7 +3053,6 @@ exports[`Renderer:text with options and multiple and delimiter: second option se
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
aria-owns="downshift-1-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened cxd-TextControl-input--multiple has-popover"
role="combobox"
@ -3096,7 +3087,6 @@ exports[`Renderer:text with options and multiple and delimiter: second option se
<input
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-labelledby="downshift-1-label"
autocomplete="off"
class=""
id="downshift-1-input"
@ -3350,7 +3340,6 @@ exports[`Renderer:text with options and multiple and delimiter: thrid option cre
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
class="cxd-TextControl-input cxd-TextControl-input--withAC cxd-TextControl-input--multiple"
role="combobox"
>
@ -3395,7 +3384,6 @@ exports[`Renderer:text with options and multiple and delimiter: thrid option cre
</div>
<input
aria-autocomplete="list"
aria-labelledby="downshift-1-label"
autocomplete="off"
class=""
id="downshift-1-input"
@ -3541,7 +3529,6 @@ exports[`Renderer:text with options: options is open 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
aria-owns="downshift-0-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened has-popover"
role="combobox"
@ -3550,7 +3537,6 @@ exports[`Renderer:text with options: options is open 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-0-menu"
aria-labelledby="downshift-0-label"
autocomplete="off"
class=""
id="downshift-0-input"
@ -3786,7 +3772,6 @@ exports[`Renderer:text with options: select first option 1`] = `
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
aria-owns="downshift-0-menu"
class="cxd-TextControl-input cxd-TextControl-input--withAC is-opened"
role="combobox"
@ -3794,7 +3779,6 @@ exports[`Renderer:text with options: select first option 1`] = `
<input
aria-autocomplete="list"
aria-controls="downshift-0-menu"
aria-labelledby="downshift-0-label"
autocomplete="off"
class=""
id="downshift-0-input"

View File

@ -12,7 +12,7 @@ import {
} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
test('Renderer:chained-select', async () => {
const fetcher = jest.fn().mockImplementation((config: any) => {
@ -124,5 +124,6 @@ test('Renderer:chained-select', async () => {
.length
).toBe(4);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -26,7 +26,7 @@ import {
} from '@testing-library/react';
import '../../../src';
import {render as amisRender, clearStoresCache} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
afterEach(() => {
cleanup();
@ -140,6 +140,7 @@ test('Renderer:combo with items & multiLine', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -267,6 +268,8 @@ test('Renderer:combo with minLength & maxLength', async () => {
expect(
container.querySelector('form.cxd-Form > .cxd-Form-item')!
).toHaveClass('is-error');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('minLength error');
const addBtn = container.querySelector('button.cxd-Combo-addBtn')!;
@ -395,6 +398,8 @@ test('Renderer:combo with unique', async () => {
expect(
container.querySelector('form.cxd-Form > .cxd-Form-item')!
).toHaveClass('is-error');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('unique error');
fireEvent.change(inputTexts[1], {
@ -441,6 +446,8 @@ test('Renderer:combo with draggable', async () => {
]);
expect(container.querySelectorAll('.cxd-Combo-itemDrager')!.length).toBe(2);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -531,6 +538,7 @@ test('Renderer:combo with conditions', async () => {
expect(addBtn).toBeInTheDocument();
fireEvent.click(addBtn);
await waitFor(() => {
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('add button open');
});
@ -614,6 +622,7 @@ test('Renderer:combo with canAccessSuperData & strictMode & syncFields', async (
}
]);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
const parentInput = container.querySelector('.parentInput input')!;
@ -675,6 +684,8 @@ test('Renderer:combo with tabsMode', async () => {
expect(
container.querySelector('.cxd-ComboControl .cxd-Tabs.cxd-ComboTabs')
).toBeInTheDocument();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -775,6 +786,7 @@ test('Renderer:combo with addable & addattop & addBtn & addButtonText & addButto
container.querySelector('.addableClass .cxd-Combo-toolbar button')!
).not.toBeInTheDocument();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -875,6 +887,7 @@ test('Renderer:combo with removable & deleteBtn & deleteApi & deleteConfirmText'
container.querySelector('.superDeleteBtn .cxd-Combo-delController')!
).toBeInTheDocument();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(

View File

@ -17,7 +17,7 @@ import React from 'react';
import {fireEvent, render, screen, waitFor} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
const testSchema = {
type: 'page',
@ -114,6 +114,7 @@ const testSchema = {
test('Renderer:condition-builder', () => {
const {container} = render(amisRender(testSchema, {}, makeEnv({})));
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -669,9 +670,7 @@ test('Renderer:condition-builder with selectMode', async () => {
fireEvent.click(await findByText('添加条件'));
fireEvent.click(await findByText('请选择字段'));
expect(
container.querySelector('.cxd-TreeSelection')
).toBeInTheDocument();
expect(container.querySelector('.cxd-TreeSelection')).toBeInTheDocument();
// expect(container).toMatchSnapshot();
});

View File

@ -2,7 +2,7 @@ import React = require('react');
import {fireEvent, render} from '@testing-library/react';
import '../../../src';
import {render as amisRender, setIconVendor} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
test('Renderer:icon-picker', async () => {
const vendors = [
@ -58,5 +58,6 @@ test('Renderer:icon-picker', async () => {
fireEvent.click(getByTitle('glyphicon glyphicon-plus'));
await wait(500);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -16,7 +16,7 @@ import {
} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
const setup = async (items: any[] = []) => {
const onSubmit = jest.fn();
@ -122,6 +122,7 @@ test('Renderer:inputCity', async () => {
});
});
await wait(200);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
}, 10000);
@ -142,6 +143,7 @@ test('Renderer:inputCity with searchable', async () => {
fireEvent.click(select);
await wait(100);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('open select');
const input = select.querySelector('.cxd-Select-input input')!;

View File

@ -7,7 +7,7 @@ import {
} from '@testing-library/react';
import '../../../src';
import {render as amisRender, clearStoresCache} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
afterEach(() => {
cleanup();
@ -62,6 +62,7 @@ test('Renderer:input table', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -192,6 +193,7 @@ test('Renderer:input table add', async () => {
// TODO: 这里不对,难道是点击出错了
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -271,6 +273,7 @@ test('Renderer:input-table with combo column', async () => {
});
// input-table 中套 combo。多次 lazy change 所以时间需要长点
await wait(1000);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(submitBtn);
@ -345,6 +348,7 @@ test('Renderer:input-table verifty', async () => {
const submitBtn = await findByText('submitBtn');
fireEvent.click(submitBtn);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
const input = await findByPlaceholderText('请输入数字');
@ -434,5 +438,6 @@ test('Renderer:input-table cell selects delete', async () => {
}
]
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -7,7 +7,7 @@ import {
} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
import {clearStoresCache} from '../../../src';
afterEach(() => {
@ -58,6 +58,7 @@ describe('Renderer:InputTag', () => {
const {container, input} = await setupInputTag({placeholder});
expect(input.placeholder).toBe(placeholder);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -71,6 +72,7 @@ describe('Renderer:InputTag', () => {
const option = screen.getByText('Apple');
expect(option).toBeVisible();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -88,6 +90,7 @@ describe('Renderer:InputTag', () => {
const option = screen.getByText('Honey-dew melon');
expect(option).toHaveClass('cxd-ResultBox-valueLabel');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -110,6 +113,7 @@ describe('Renderer:InputTag', () => {
const Banana = screen.getByText('Banana');
expect(Banana).toHaveClass('cxd-ResultBox-valueLabel');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -135,6 +139,7 @@ describe('Renderer:InputTag', () => {
const Banana = screen.getByText('Banana');
expect(Banana).toHaveClass('cxd-ResultBox-valueLabel');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -168,6 +173,7 @@ describe('Renderer:InputTag', () => {
const Banana = queryByText('Banana');
expect(Banana).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
}, 10000);
@ -194,6 +200,7 @@ describe('Renderer:InputTag', () => {
const Banana = queryByText('Banana');
expect(Banana).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
}, 10000);
});

View File

@ -14,7 +14,7 @@
import {render, fireEvent, waitFor} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
const setup = async (
inputOptions: any = {},
@ -105,6 +105,7 @@ test('Renderer:number', async () => {
await wait(300);
expect(input?.value).toEqual('456');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -145,6 +146,8 @@ test('Renderer:number with prefix & suffix & kilobitSeparator', async () => {
});
expect(input.value).toEqual('$123,456%');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -178,6 +181,7 @@ test('Renderer:number with unitOptions', async () => {
await wait(300);
expect(staticDom.innerHTML).toBe('99em');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -189,6 +193,8 @@ test('Renderer:number with precision and default value', async () => {
});
expect(input.value).toBe('2.99');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -221,6 +227,7 @@ test('Renderer:number with step & precision & displayMode & keyboard', async ()
// await wait(300);
// expect(input.value).toBe('17.111');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -271,5 +278,6 @@ test('Renderer:number with big value', async () => {
await wait(300);
expect(input.value).toEqual('99999999999999999.99'); // 最大值
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -2,7 +2,7 @@ import React = require('react');
import {render, fireEvent} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv} from '../../helper';
import {makeEnv, replaceReactAriaIds} from '../../helper';
test('Renderer:repeat', async () => {
const {container, getByText} = render(
@ -45,5 +45,6 @@ test('Renderer:repeat', async () => {
fireEvent.click(getByText('年'));
fireEvent.click(getByText('年'));
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -19,7 +19,7 @@
import {render, screen, fireEvent, waitFor} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
const setup = async (items: any = {}, formOptions: any = {}) => {
const utils = render(
@ -84,6 +84,7 @@ test('Renderer:select menutpl', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -151,6 +152,7 @@ test('Renderer:select group', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -219,6 +221,7 @@ test('Renderer:select table', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -302,6 +305,7 @@ test('Renderer:select table with labelField & valueField', async () => {
await wait(500);
fireEvent.click(await findByText('李白'));
await wait(500);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(await findByText('Submit'));
@ -374,6 +378,7 @@ test('Renderer:select tree', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -441,6 +446,7 @@ test('Renderer:select chained', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -511,6 +517,7 @@ test('Renderer: chained select', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -631,6 +638,7 @@ test('Renderer:select associated', () => {
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -663,6 +671,7 @@ test('Renderer:select virtual', async () => {
const option12 = queryByText('option12');
expect(option12).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -691,6 +700,8 @@ test('Renderer:select group mode with virtual', async () => {
expect(getByText('option-1')).toBeInTheDocument();
expect(await queryByText('option-200')).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -726,6 +737,8 @@ test('Renderer:select table mode with virtual', async () => {
expect(getByText('label-1')).toBeInTheDocument();
expect(await queryByText('label-200')).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('');
});
@ -759,6 +772,7 @@ test('Renderer:select chained mode with virtual', async () => {
expect(getByText('group-1-option-1')).toBeInTheDocument();
expect(await queryByText('group-1-option-100')).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('');
});
@ -815,6 +829,7 @@ test('Renderer:select associated mode with virtual', async () => {
expect(getByText('label-1')).toBeInTheDocument();
expect(await queryByText('label-100')).toBeNull();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('');
});

View File

@ -2,7 +2,7 @@ import React = require('react');
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
import {clearStoresCache} from '../../../src';
afterEach(() => {
@ -78,6 +78,8 @@ test('Renderer:service', async () => {
).not.toBeInTheDocument();
});
expect(fetcher).toHaveBeenCalled();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -134,7 +136,9 @@ test('form:service:remoteData', async () => {
).not.toBeInTheDocument();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(getByText('Submit'));
await waitFor(() => {
expect(onSubmit).toBeCalled();
@ -205,7 +209,9 @@ test('form:service:remoteSchmea+data', async () => {
).not.toBeInTheDocument();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(getByText('Submit'));
await waitFor(() => {
expect(onSubmit).toBeCalled();
@ -325,5 +331,6 @@ test('form:service:super-remoteData', async () => {
).not.toBeInTheDocument();
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -2,7 +2,7 @@ import React = require('react');
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv, wait} from '../../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../../helper';
import {clearStoresCache} from '../../../src';
afterEach(() => {
@ -68,6 +68,7 @@ const setup = async (
test('Renderer:text', async () => {
const {container, input} = await setup();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
// 输入是否正常
fireEvent.change(input, {target: {value: 'AbCd'}});
@ -87,10 +88,14 @@ test('Renderer:text type is url', async () => {
fireEvent.change(input, {target: {value: 'abcd'}});
fireEvent.click(submitBtn);
await wait(200); // 表单校验是异步的,所以必须要等一段时间 @todo 感觉可能需要寻找更靠谱的办法
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('validate fail');
fireEvent.change(input, {target: {value: 'https://www.baidu.com'}});
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('validate success');
});
@ -105,10 +110,14 @@ test('Renderer:text type is email', async () => {
fireEvent.change(input, {target: {value: 'abcd'}});
fireEvent.click(submitBtn);
await wait(200);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('validate fail');
fireEvent.change(input, {target: {value: 'test@baidu.com'}});
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('validate success');
});
@ -124,6 +133,8 @@ test('Renderer:text type is password', async () => {
await wait(300);
expect(input.getAttribute('type')).toBe('password');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('password invisible');
const revealPasswordBtn = container.querySelector(
@ -135,6 +146,8 @@ test('Renderer:text type is password', async () => {
await wait(300);
expect(input.getAttribute('type')).toBe('text');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('password visible');
});
@ -153,6 +166,8 @@ test('Renderer:text type is password with revealPassword', async () => {
fireEvent.change(input, {target: {value: 'abcd'}});
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -167,6 +182,7 @@ test('Renderer:text with addOn', async () => {
}
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -179,6 +195,8 @@ test('Renderer:text with clearable', async () => {
});
fireEvent.change(input, {target: {value: 'abcd'}}); // 有值之后才会显示clear的icon
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.click(
@ -204,6 +222,8 @@ test('Renderer:text with options', async () => {
}
]
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
// 展开 options
@ -211,6 +231,8 @@ test('Renderer:text with options', async () => {
container.querySelector('.cxd-TextControl-input') as HTMLElement
);
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('options is open');
// 选中一项
@ -221,6 +243,8 @@ test('Renderer:text with options', async () => {
);
await wait(300);
// expect(input.value).toBe('a');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('select first option');
});
@ -269,6 +293,8 @@ test('Renderer:text with options and multiple and delimiter', async () => {
// 展开 options
fireEvent.click(textControl);
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('options is opened');
// 选中第一项
@ -279,11 +305,15 @@ test('Renderer:text with options and multiple and delimiter', async () => {
);
await wait(300);
// expect(input.value).toBe('a');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('first option selected');
// 再次打开 options
fireEvent.click(textControl);
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot(
'options is opened again, and first option already selected'
);
@ -301,6 +331,7 @@ test('Renderer:text with options and multiple and delimiter', async () => {
(container.querySelector('.cxd-PlainField') as Element).innerHTML
).toBe('a-b');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('second option selected');
// 可创建
@ -315,6 +346,7 @@ test('Renderer:text with options and multiple and delimiter', async () => {
(container.querySelector('.cxd-PlainField') as Element).innerHTML
).toBe('a-b-AbCd');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot('thrid option create');
});
@ -327,6 +359,7 @@ test('Renderer:text with prefix and suffix', async () => {
suffix: 'RMB'
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -337,10 +370,14 @@ test('Renderer:text with counter', async () => {
const {container, input} = await setup({
showCounter: true
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.change(input, {target: {value: 'abcd'}});
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -352,6 +389,8 @@ test('Renderer:text with counter and maxLength', async () => {
showCounter: true,
maxLength: 10
});
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
fireEvent.change(input, {target: {value: 'abcd'}});
@ -361,6 +400,8 @@ test('Renderer:text with counter and maxLength', async () => {
).toBeInTheDocument();
});
await wait(300);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -471,5 +512,6 @@ test('Renderer:text with minLength', async () => {
container.querySelector('.cxd-TextControl.has-error--maxLength') as Element
).toBeInTheDocument();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -15,7 +15,7 @@
import {fireEvent, render, waitFor, within} from '@testing-library/react';
import '../../src';
import {render as amisRender} from '../../src';
import {makeEnv, wait} from '../helper';
import {makeEnv, replaceReactAriaIds, wait} from '../helper';
import rows from '../mockData/rows';
// 1. pagination-wrapper
@ -57,7 +57,7 @@ test('Renderer:Pagination', () => {
makeEnv({})
)
);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -86,6 +86,7 @@ test('Renderer:Pagination', () => {
]
};
const {container} = render(amisRender(schema, {}, makeEnv({})));
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -140,7 +141,7 @@ test('Renderer:Pagination with simple mode', async () => {
await wait(100);
expect(next).toHaveClass('is-disabled');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -172,6 +173,7 @@ test('Renderer:Pagination with layout', () => {
expect(children[2]).toHaveClass('cxd-Pagination-perpage');
expect(children[3]).toHaveClass('cxd-Pagination');
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -196,6 +198,7 @@ test('Renderer:Pagination with maxButtons', () => {
);
expect(pager.length).toBe(10);
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});
@ -277,6 +280,7 @@ test('Renderer:Pagination with showPerPage & perPageAvailable & showPageInput',
makeEnv({})
)
);
replaceReactAriaIds(container);
function getLastPagerItem() {
const pager = container.querySelectorAll(
@ -353,5 +357,6 @@ test('Renderer:Pagination with disabled', async () => {
await wait(200);
expect(pageChange).not.toBeCalled();
replaceReactAriaIds(container);
expect(container).toMatchSnapshot();
});

View File

@ -1383,766 +1383,6 @@ exports[`Renderer: crud keepItemSelectionOnPageChange & maxKeepItemSelectionLeng
</div>
`;
exports[`Renderer: crud sortable & orderBy & orderDir & orderField 1`] = `
<div>
<div
class="cxd-Page"
>
<div
class="cxd-Page-content"
>
<div
class="cxd-Page-main"
>
<div
class="cxd-Page-body"
role="page-body"
>
<div
class="cxd-Crud"
>
<div
class="cxd-Table cxd-Crud-body"
>
<div
class="cxd-Table-contentWrap"
>
<div
class="cxd-Table-fixedLeft"
/>
<div
class="cxd-Table-fixedRight"
/>
<div
class="cxd-Table-content"
style="position: relative;"
>
<table
class="cxd-Table-table"
>
<thead>
<tr
class=""
>
<th
class="cxd-TableCell--sortable"
data-index="3"
>
<div
class="cxd-TableCell--title"
>
<span
class="cxd-TplField"
>
<span>
ID
</span>
</span>
</div>
<span
class="cxd-TableCell-sortBtn"
data-index="3"
>
<i
class="cxd-TableCell-sortBtn--down"
>
<icon-mock
classname="icon icon-sort-desc"
icon="sort-desc"
/>
</i>
<i
class="cxd-TableCell-sortBtn--up"
>
<icon-mock
classname="icon icon-sort-asc"
icon="sort-asc"
/>
</i>
<i
class="cxd-TableCell-sortBtn--default is-active"
>
<icon-mock
classname="icon icon-sort-default"
icon="sort-default"
/>
</i>
</span>
<div
class="cxd-Table-content-colDragLine"
/>
</th>
<th
class=""
data-index="4"
>
<div
class="cxd-TableCell--title"
>
<span
class="cxd-TplField"
>
<span>
Rendering engine
</span>
</span>
</div>
<div
class="cxd-Table-content-colDragLine"
/>
</th>
</tr>
</thead>
<tbody>
<tr
class="cxd-Table-tr--odd cxd-Table-tr--1th"
data-id="1"
data-index="0"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
1
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Trident
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--even cxd-Table-tr--1th"
data-id="2"
data-index="1"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
2
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Trident
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--odd cxd-Table-tr--1th"
data-id="3"
data-index="2"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
3
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Trident
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--even cxd-Table-tr--1th"
data-id="4"
data-index="3"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
4
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Trident
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--odd cxd-Table-tr--1th"
data-id="5"
data-index="4"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
5
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Trident
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--even cxd-Table-tr--1th"
data-id="6"
data-index="5"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
6
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Gecko
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--odd cxd-Table-tr--1th"
data-id="7"
data-index="6"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
7
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Gecko
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--even cxd-Table-tr--1th"
data-id="8"
data-index="7"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
8
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Gecko
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--odd cxd-Table-tr--1th"
data-id="9"
data-index="8"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
9
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Gecko
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
<tr
class="cxd-Table-tr--even cxd-Table-tr--1th"
data-id="10"
data-index="9"
>
<td
class=""
>
<span
class="cxd-PlainField"
>
10
</span>
</td>
<td
class="cxd-Field--quickEditable"
tabindex="0"
>
<span
class="cxd-PlainField"
>
Gecko
</span>
<span
class="cxd-Field-quickEditBtn"
>
<icon-mock
classname="icon icon-edit"
icon="edit"
/>
</span>
</td>
</tr>
</tbody>
</table>
<div
class="resize-sensor"
style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: scroll; z-index: -1; visibility: hidden;"
>
<div
class="resize-sensor-expand"
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
>
<div
style="position: absolute; left: 0px; top: 0px; width: 10px; height: 10px;"
/>
</div>
<div
class="resize-sensor-shrink"
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;"
>
<div
style="position: absolute; left: 0; top: 0; width: 200%; height: 200%"
/>
</div>
<div
class="resize-sensor-appear"
style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;animation-name: apearSensor; animation-duration: 0.2s;"
/>
</div>
</div>
<div
class="cxd-Spinner-overlay"
/>
<div
class="cxd-Spinner cxd-Spinner--overlay"
data-testid="spinner"
>
<div
class="cxd-Spinner-icon cxd-Spinner-icon--default"
/>
</div>
</div>
<div
class="cxd-Table-fixedTop"
>
<div
class="cxd-Table-fixedLeft"
/>
<div
class="cxd-Table-fixedRight"
/>
<div
class="cxd-Table-wrapper"
style="width: 0px;"
>
<table
class="cxd-Table-table"
style="width: 0px; table-layout: auto; transform: translateX(-0px);"
>
<colgroup>
<col
data-index="3"
width="0"
/>
<col
data-index="4"
width="0"
/>
</colgroup>
<thead>
<tr>
<th
class="cxd-TableCell--sortable"
data-index="3"
style="width: 0px; height: 0px;"
>
<div
class="cxd-TableCell--title"
>
<span
class="cxd-TplField"
>
<span>
ID
</span>
</span>
</div>
<span
class="cxd-TableCell-sortBtn"
data-index="3"
>
<i
class="cxd-TableCell-sortBtn--down"
>
<icon-mock
classname="icon icon-sort-desc"
icon="sort-desc"
/>
</i>
<i
class="cxd-TableCell-sortBtn--up"
>
<icon-mock
classname="icon icon-sort-asc"
icon="sort-asc"
/>
</i>
<i
class="cxd-TableCell-sortBtn--default is-active"
>
<icon-mock
classname="icon icon-sort-default"
icon="sort-default"
/>
</i>
</span>
<div
class="cxd-Table-content-colDragLine"
/>
</th>
<th
class=""
data-index="4"
style="width: 0px; height: 0px;"
>
<div
class="cxd-TableCell--title"
>
<span
class="cxd-TplField"
>
<span>
Rendering engine
</span>
</span>
</div>
<div
class="cxd-Table-content-colDragLine"
/>
</th>
</tr>
</thead>
</table>
</div>
</div>
<div
class="cxd-Table-toolbar cxd-Table-footToolbar"
>
<div
class="cxd-Crud-toolbar"
>
<div
class="cxd-Crud-toolbar-item cxd-Crud-toolbar-item--left"
>
<div
class="cxd-Crud-statistics"
>
1/15 共144 项
</div>
</div>
<div
class="cxd-Crud-toolbar-item cxd-Crud-toolbar-item--right"
>
<div
class="cxd-Crud-pager"
>
<div
class="cxd-Pagination-wrap"
>
<ul
class="cxd-Pagination cxd-Pagination--sm cxd-Pagination-item"
>
<li
class="cxd-Pagination-prev is-disabled"
>
<span>
<icon-mock
classname="icon icon-left-arrow"
icon="left-arrow"
/>
</span>
</li>
<li
class="cxd-Pagination-pager-item is-active"
>
<a
role="button"
>
1
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
2
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
3
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
4
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
5
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
6
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
7
</a>
</li>
<li
class="ellipsis"
>
<a
role="button"
>
...
</a>
</li>
<li
class="cxd-Pagination-pager-item"
>
<a
role="button"
>
15
</a>
</li>
<li
class="cxd-Pagination-next"
>
<span>
<icon-mock
classname="icon icon-right-arrow"
icon="right-arrow"
/>
</span>
</li>
</ul>
<div
class="cxd-Pagination-inputGroup cxd-Pagination-item"
>
<span
class="cxd-Pagination-inputGroup-left"
>
跳转至
</span>
<input
class="cxd-Pagination-inputGroup-input"
type="text"
value=""
/>
<span
class="cxd-Pagination-inputGroup-right"
>
GO
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`Renderer:crud basic interval headerToolbar footerToolbar 1`] = `
<div>
<div
@ -2944,7 +2184,6 @@ exports[`Renderer:crud basic interval headerToolbar footerToolbar 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select cxd-Pagination-perpage cxd-Pagination-item"
role="combobox"
tabindex="0"

View File

@ -342,7 +342,6 @@ exports[`Renderer:Pagination 2`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-0-label"
class="cxd-Select cxd-Pagination-perpage cxd-Pagination-item"
role="combobox"
tabindex="0"
@ -620,7 +619,6 @@ exports[`Renderer:Pagination with layout 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="downshift-1-label"
class="cxd-Select cxd-Pagination-perpage cxd-Pagination-item"
role="combobox"
tabindex="0"
@ -902,7 +900,6 @@ exports[`Renderer:Pagination with showPerPage & perPageAvailable & showPageInput
<div
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="downshift-2-label"
aria-owns="downshift-2-menu"
class="cxd-Select is-opened cxd-Pagination-perpage cxd-Pagination-item has-popover"
role="combobox"