mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-04-06 15:30:30 +08:00
chore(engine): Reorder triggerEvents in validate and resetValidation methods.
This commit is contained in:
parent
66e5e2a699
commit
4f838cf0a1
@ -174,12 +174,12 @@ test('RestValidation after required field', async () => {
|
||||
const button = context._internal.RootBlocks.map['button'];
|
||||
const reset = context._internal.RootBlocks.map['reset'];
|
||||
const text1 = context._internal.RootBlocks.map['text1'];
|
||||
await button.triggerEvent({ name: 'onClick' });
|
||||
expect(text1.eval.validation).toEqual({
|
||||
errors: ['This field is required'],
|
||||
status: 'error',
|
||||
status: null,
|
||||
warnings: [],
|
||||
});
|
||||
await button.triggerEvent({ name: 'onClick' });
|
||||
expect(button.Events.events.onClick.history[0]).toEqual({
|
||||
blockId: 'button',
|
||||
bounced: false,
|
||||
|
@ -339,12 +339,12 @@ test('Validate all fields', async () => {
|
||||
const button = context._internal.RootBlocks.map['button'];
|
||||
const text1 = context._internal.RootBlocks.map['text1'];
|
||||
const text2 = context._internal.RootBlocks.map['text2'];
|
||||
await button.triggerEvent({ name: 'onClick' });
|
||||
expect(text1.eval.validation).toEqual({
|
||||
errors: ['text1 does not match pattern "text1"'],
|
||||
status: 'error',
|
||||
status: null,
|
||||
warnings: [],
|
||||
});
|
||||
await button.triggerEvent({ name: 'onClick' });
|
||||
expect(button.Events.events.onClick.history[0]).toEqual({
|
||||
blockId: 'button',
|
||||
bounced: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user