We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 033b56d commit 3f97aa6Copy full SHA for 3f97aa6
apps/sim/tools/utils.test.ts
@@ -91,6 +91,25 @@ describe('transformTable', () => {
91
enabled: false,
92
})
93
94
+
95
+ it.concurrent('should parse JSON string inputs and transform rows', () => {
96
+ const table = [
97
+ { id: '1', cells: { Key: 'city', Value: 'SF' } },
98
+ { id: '2', cells: { Key: 'temp', Value: 64 } },
99
+ ]
100
+ const result = transformTable(JSON.stringify(table))
101
102
+ expect(result).toEqual({
103
+ city: 'SF',
104
+ temp: 64,
105
+ })
106
107
108
+ it.concurrent('should parse JSON string object inputs', () => {
109
+ const result = transformTable(JSON.stringify({ a: 1, b: 'two' }))
110
111
+ expect(result).toEqual({ a: 1, b: 'two' })
112
113
114
115
describe('formatRequestParams', () => {
0 commit comments