feat(editor): Update element-plus to 2.4.3 (no-changelog) (#10281)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
committed by
GitHub
parent
03c19723d2
commit
ecd287564d
@@ -10,7 +10,6 @@ exports[`components > N8nCheckbox > should render with both child and label 1`]
|
||||
class="el-checkbox__input"
|
||||
>
|
||||
<input
|
||||
aria-hidden="false"
|
||||
class="el-checkbox__original"
|
||||
type="checkbox"
|
||||
value="Checkbox"
|
||||
@@ -71,7 +70,6 @@ exports[`components > N8nCheckbox > should render with child 1`] = `
|
||||
class="el-checkbox__input"
|
||||
>
|
||||
<input
|
||||
aria-hidden="false"
|
||||
class="el-checkbox__original"
|
||||
type="checkbox"
|
||||
/>
|
||||
@@ -106,7 +104,6 @@ exports[`components > N8nCheckbox > should render with label 1`] = `
|
||||
class="el-checkbox__input"
|
||||
>
|
||||
<input
|
||||
aria-hidden="false"
|
||||
class="el-checkbox__original"
|
||||
type="checkbox"
|
||||
value="Checkbox"
|
||||
@@ -164,7 +161,6 @@ exports[`components > N8nCheckbox > should render without label and child conten
|
||||
class="el-checkbox__input"
|
||||
>
|
||||
<input
|
||||
aria-hidden="false"
|
||||
class="el-checkbox__original"
|
||||
type="checkbox"
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,7 @@ exports[`components > N8nColorPicker > should render with input 1`] = `
|
||||
|
||||
<div
|
||||
aria-description="current color is . press enter to select a new color."
|
||||
aria-disabled="false"
|
||||
aria-label="color picker"
|
||||
class="el-color-picker el-color-picker--large el-tooltip__trigger el-tooltip__trigger"
|
||||
role="button"
|
||||
@@ -106,6 +107,7 @@ exports[`components > N8nColorPicker > should render without input 1`] = `
|
||||
|
||||
<div
|
||||
aria-description="current color is . press enter to select a new color."
|
||||
aria-disabled="false"
|
||||
aria-label="color picker"
|
||||
class="el-color-picker el-color-picker--large el-tooltip__trigger el-tooltip__trigger"
|
||||
role="button"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { render } from '@testing-library/vue';
|
||||
import N8nDatatable from '../Datatable.vue';
|
||||
import { rows, columns } from './data';
|
||||
import { removeDynamicAttributes } from 'n8n-design-system/utils';
|
||||
|
||||
const stubs = [
|
||||
'n8n-option',
|
||||
@@ -33,6 +34,7 @@ describe('components', () => {
|
||||
expect(wrapper.container.querySelectorAll('tbody tr td').length).toEqual(
|
||||
columns.length * rowsPerPage,
|
||||
);
|
||||
removeDynamicAttributes(wrapper.container);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ exports[`components > N8nDatatable > should render correctly 1`] = `
|
||||
<div class="el-select el-select--small" popperappendtobody="false" limitpopperwidth="false">
|
||||
<div class="select-trigger el-tooltip__trigger el-tooltip__trigger">
|
||||
<!--v-if-->
|
||||
<!-- fix: https://github.com/element-plus/element-plus/issues/11415 -->
|
||||
<!--v-if-->
|
||||
<div class="el-input el-input--small el-input--suffix">
|
||||
<!-- input -->
|
||||
@@ -121,7 +120,7 @@ exports[`components > N8nDatatable > should render correctly 1`] = `
|
||||
<!--v-if-->
|
||||
<div class="el-input__wrapper">
|
||||
<!-- prefix slot -->
|
||||
<!--v-if--><input class="el-input__inner" type="text" readonly="" autocomplete="off" tabindex="0" placeholder="Select"><!-- suffix slot --><span class="el-input__suffix"><span class="el-input__suffix-inner"><i class="el-icon el-select__caret el-select__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--></span></span>
|
||||
<!--v-if--><input class="el-input__inner" role="combobox" aria-activedescendant="" aria-expanded="false" aria-autocomplete="none" aria-haspopup="listbox" type="text" readonly="" autocomplete="off" tabindex="0" placeholder="Select"><!-- suffix slot --><span class="el-input__suffix"><span class="el-input__suffix-inner"><i class="el-icon el-select__caret el-select__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--></span></span>
|
||||
</div><!-- append slot -->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { render, waitFor, within } from '@testing-library/vue';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import N8nSelect from '../Select.vue';
|
||||
import N8nOption from '../../N8nOption/Option.vue';
|
||||
import { removeDynamicAttributes } from 'n8n-design-system/utils';
|
||||
|
||||
describe('components', () => {
|
||||
describe('N8nSelect', () => {
|
||||
@@ -21,6 +22,7 @@ describe('components', () => {
|
||||
],
|
||||
},
|
||||
});
|
||||
removeDynamicAttributes(wrapper.container);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ exports[`components > N8nSelect > should render correctly 1`] = `
|
||||
<div class="el-select el-select--large" popperappendtobody="false" limitpopperwidth="false">
|
||||
<div class="select-trigger el-tooltip__trigger el-tooltip__trigger">
|
||||
<!--v-if-->
|
||||
<!-- fix: https://github.com/element-plus/element-plus/issues/11415 -->
|
||||
<!--v-if-->
|
||||
<div class="el-input el-input--large el-input--suffix">
|
||||
<!-- input -->
|
||||
@@ -14,7 +13,7 @@ exports[`components > N8nSelect > should render correctly 1`] = `
|
||||
<!--v-if-->
|
||||
<div class="el-input__wrapper">
|
||||
<!-- prefix slot -->
|
||||
<!--v-if--><input class="el-input__inner" type="text" readonly="" autocomplete="off" tabindex="0" placeholder="Select"><!-- suffix slot --><span class="el-input__suffix"><span class="el-input__suffix-inner"><i class="el-icon el-select__caret el-select__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--></span></span>
|
||||
<!--v-if--><input class="el-input__inner" role="combobox" aria-activedescendant="" aria-expanded="false" aria-autocomplete="none" aria-haspopup="listbox" type="text" readonly="" autocomplete="off" tabindex="0" placeholder="Select"><!-- suffix slot --><span class="el-input__suffix"><span class="el-input__suffix-inner"><i class="el-icon el-select__caret el-select__icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path></svg></i><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--><!--v-if--></span></span>
|
||||
</div><!-- append slot -->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
|
||||
@@ -4,3 +4,4 @@ export * from './markdown';
|
||||
export * from './typeguards';
|
||||
export * from './uid';
|
||||
export * from './valueByPath';
|
||||
export * from './testUtils';
|
||||
|
||||
18
packages/design-system/src/utils/testUtils.ts
Normal file
18
packages/design-system/src/utils/testUtils.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
const DYNAMIC_ATTRIBUTES = ['aria-controls'];
|
||||
|
||||
/**
|
||||
* Deletes dynamic attributes from the container children so snapshots can be tested.
|
||||
*
|
||||
* Background:
|
||||
* Vue test utils use server rendering to render components (https://v1.test-utils.vuejs.org/api/render.html#render).
|
||||
* Element UI in SSR mode adds dynamic attributes to the rendered HTML each time the test is run (https://element-plus.org/en-US/guide/ssr#provide-an-id).
|
||||
*
|
||||
* NOTE: Make sure to manually remove same attributes from the expected snapshot.
|
||||
*/
|
||||
// TODO: Find a way to inject static value for dynamic attributes in tests
|
||||
export function removeDynamicAttributes(container: Element): void {
|
||||
DYNAMIC_ATTRIBUTES.forEach((attribute) => {
|
||||
const elements = container.querySelectorAll(`[${attribute}]`);
|
||||
elements.forEach((element) => element.removeAttribute(attribute));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user