chore: avoid test error

This commit is contained in:
Rairn 2023-06-10 07:31:32 +08:00
parent 8d4123d8d6
commit 7e9f3dfa17

View File

@ -12,7 +12,7 @@ describe('Variable', () => {
await userEvent.click(screen.getByText('x')); await userEvent.click(screen.getByText('x'));
await userEvent.click(screen.getByText('v1')); await userEvent.click(screen.getByText('v1'));
await sleep(); await sleep(100);
expect(screen.getByText('v1', { selector: '.ant-tag' })).toMatchInlineSnapshot(` expect(screen.getByText('v1', { selector: '.ant-tag' })).toMatchInlineSnapshot(`
<span <span
class="ant-tag ant-tag-blue" class="ant-tag ant-tag-blue"
@ -32,11 +32,11 @@ describe('Variable', () => {
expect(variableSelector).toBeInTheDocument(); expect(variableSelector).toBeInTheDocument();
await userEvent.type(input, '1+'); await userEvent.type(input, '1+');
await sleep(); await sleep(100);
await userEvent.click(variableSelector); await userEvent.click(variableSelector);
await userEvent.click(screen.getByText('v1')); await userEvent.click(screen.getByText('v1'));
await sleep(); await sleep(100);
expect(input).toMatchInlineSnapshot(` expect(input).toMatchInlineSnapshot(`
<div <div
class="ant-input css-1p5yrh5" class="ant-input css-1p5yrh5"
@ -67,7 +67,7 @@ describe('Variable', () => {
await userEvent.type(input, '{{ "a": "'); await userEvent.type(input, '{{ "a": "');
await userEvent.click(variableSelector); await userEvent.click(variableSelector);
await userEvent.click(screen.getByText('v1')); await userEvent.click(screen.getByText('v1'));
await sleep(); await sleep(100);
await userEvent.type(input, '" }'); await userEvent.type(input, '" }');
expect(input.value).toMatchInlineSnapshot('"{ \\"a\\": \\"{{v1}}\\" }"'); expect(input.value).toMatchInlineSnapshot('"{ \\"a\\": \\"{{v1}}\\" }"');