■ ■ ■ ■ ■ ■
packages/public-api/src/clientApiRouter.test.ts
| skipped 84 lines |
85 | 85 | | webPageScan.id.toString() |
86 | 86 | | ); |
87 | 87 | | |
| 88 | + | const url = '/client/getWebPageScan?batch=1&input=' + encodeURIComponent(JSON.stringify({'0' : siteUrl})); |
88 | 89 | | const responseGet = await api |
89 | | - | .get('/client/getWebPageScan') |
| 90 | + | .get(url) |
90 | 91 | | .set('Origin', 'http://localhost:3000') |
91 | | - | .send(JSON.stringify(siteUrl)) |
92 | 92 | | .expect(200); |
93 | | - | expect(responseGet.body).toMatchObject({ |
| 93 | + | expect(responseGet.body).toMatchObject([{ |
94 | 94 | | result: { |
95 | 95 | | data: { |
96 | 96 | | id: webPageScan.id.toString(), |
97 | 97 | | status: WebPageScan.Status.Pending, |
98 | 98 | | }, |
99 | 99 | | }, |
100 | | - | }); |
| 100 | + | }]); |
101 | 101 | | }); |
102 | 102 | | |
103 | 103 | | it('should return a cached scan if applicable', async () => { |
| skipped 29 lines |
133 | 133 | | |
134 | 134 | | expect(requestWebPageScanMock).toHaveBeenCalledTimes(0); |
135 | 135 | | |
| 136 | + | const url = '/client/getWebPageScan?batch=1&input=' + encodeURIComponent(JSON.stringify({'0' : siteUrl})); |
136 | 137 | | const responseGet = await api |
137 | | - | .get('/client/getWebPageScan') |
| 138 | + | .get(url) |
138 | 139 | | .set('Origin', 'http://localhost:3000') |
139 | | - | .send(JSON.stringify(siteUrl)) |
140 | 140 | | .expect(200); |
141 | | - | expect(responseGet.body).toMatchObject({ |
| 141 | + | expect(responseGet.body).toMatchObject([{ |
142 | 142 | | result: { |
143 | 143 | | data: { |
144 | 144 | | id: existingScan.id.toString(), |
| skipped 10 lines |
155 | 155 | | }, |
156 | 156 | | }, |
157 | 157 | | }, |
158 | | - | }); |
| 158 | + | }]); |
159 | 159 | | }); |
160 | 160 | | }); |
161 | 161 | | |