mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 补充几个 formula 现有实现的用例避免后续改错 (#5218)
This commit is contained in:
parent
363f389ee6
commit
9cf6a41a62
@ -58,6 +58,12 @@ test('formula:expression2', () => {
|
||||
expect(evalFormual('a[c ? 1 : 2]', {a: [1, 2, 3], b: 1})).toBe(3);
|
||||
});
|
||||
|
||||
test('formula:expression3', () => {
|
||||
expect(evalFormual('${a} === "b"', {a: 'b'})).toBe(true);
|
||||
expect(evalFormual('b === "b"')).toBe(false);
|
||||
expect(evalFormual('${a}', {a: 'b'})).toBe('b');
|
||||
});
|
||||
|
||||
test('formula:if', () => {
|
||||
expect(evalFormual('IF(true, 2, 3)')).toBe(2);
|
||||
expect(evalFormual('IF(false, 2, 3)')).toBe(3);
|
||||
|
Loading…
Reference in New Issue
Block a user