mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Fix flaky ResourceMapper unit tests (no-changelog) (#7593)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
parent
bb2c266e48
commit
9c55702661
|
@ -109,6 +109,7 @@ describe('ResourceMapper.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders field on top of the list when they are selected for matching', async () => {
|
it('renders field on top of the list when they are selected for matching', async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
const { container, getByTestId } = renderComponent(
|
const { container, getByTestId } = renderComponent(
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
|
@ -130,14 +131,15 @@ describe('ResourceMapper.vue', () => {
|
||||||
// Id should be the first field in the list
|
// Id should be the first field in the list
|
||||||
expect(container.querySelector('.parameter-item')).toContainHTML('id (using to match)');
|
expect(container.querySelector('.parameter-item')).toContainHTML('id (using to match)');
|
||||||
// Select Last Name as matching column
|
// Select Last Name as matching column
|
||||||
await userEvent.click(getByTestId('matching-column-option-Last name'));
|
await user.click(getByTestId('matching-column-option-Last name'));
|
||||||
// Now, last name should be the first field in the list
|
// Now, last name should be the first field in the list
|
||||||
expect(container.querySelector('.parameter-item div.title')).toHaveTextContent(
|
expect(container.querySelector('.parameter-item div.title')).toHaveTextContent(
|
||||||
'Last name (using to match)',
|
'Last name (using to match)',
|
||||||
);
|
);
|
||||||
});
|
}, 10000);
|
||||||
|
|
||||||
it('renders selected matching columns properly when multiple key matching is enabled', async () => {
|
it('renders selected matching columns properly when multiple key matching is enabled', async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
const { getByTestId, getAllByText, queryByText } = renderComponent(
|
const { getByTestId, getAllByText, queryByText } = renderComponent(
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
|
@ -156,7 +158,7 @@ describe('ResourceMapper.vue', () => {
|
||||||
);
|
);
|
||||||
await waitAllPromises();
|
await waitAllPromises();
|
||||||
expect(getByTestId('resource-mapper-container')).toBeInTheDocument();
|
expect(getByTestId('resource-mapper-container')).toBeInTheDocument();
|
||||||
await userEvent.click(getByTestId('matching-column-option-Username'));
|
await user.click(getByTestId('matching-column-option-Username'));
|
||||||
|
|
||||||
// Both matching columns (id and Username) should be rendered in the dropdown
|
// Both matching columns (id and Username) should be rendered in the dropdown
|
||||||
expect(
|
expect(
|
||||||
|
|
Loading…
Reference in a new issue