feat(editor): Add examples for number & boolean, add new methods (#9358)
This commit is contained in:
@@ -163,6 +163,15 @@ describe('Resolution-based completions', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('should return completions for boolean literal: {{ true.| }}', () => {
|
||||
// @ts-expect-error Spied function is mistyped
|
||||
vi.spyOn(workflowHelpers, 'resolveParameter').mockReturnValueOnce(true);
|
||||
|
||||
expect(completions('{{ true.| }}')).toHaveLength(
|
||||
natives({ typeName: 'boolean' }).length + extensions({ typeName: 'boolean' }).length,
|
||||
);
|
||||
});
|
||||
|
||||
test('should properly handle string that contain dollar signs', () => {
|
||||
// @ts-expect-error Spied function is mistyped
|
||||
vi.spyOn(workflowHelpers, 'resolveParameter').mockReturnValueOnce("You 'owe' me 200$ ");
|
||||
|
||||
@@ -847,6 +847,7 @@ const regexes = {
|
||||
|
||||
numberLiteral: /\((\d+)\.?(\d*)\)\.(.*)/, // (123). or (123.4).
|
||||
singleQuoteStringLiteral: /('.*')\.([^'{\s])*/, // 'abc'.
|
||||
booleanLiteral: /(true|false)\.([^'{\s])*/, // true.
|
||||
doubleQuoteStringLiteral: /(".*")\.([^"{\s])*/, // "abc".
|
||||
dateLiteral: /\(?new Date\(\(?.*?\)\)?\.(.*)/, // new Date(). or (new Date()).
|
||||
arrayLiteral: /\(?(\[.*\])\)?\.(.*)/, // [1, 2, 3].
|
||||
|
||||
Reference in New Issue
Block a user