Skip to content

Commit aa81c35

Browse files
author
David Hasani
committed
add test
1 parent e5b0cab commit aa81c35

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/core/src/test/codewhisperer/commands/transformByQ.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
zipCode,
2929
getTableMapping,
3030
getFilesRecursively,
31+
getJobStatisticsHtml,
3132
} from '../../../codewhisperer/service/transformByQ/transformApiHandler'
3233
import {
3334
validateOpenProjects,
@@ -312,6 +313,31 @@ dependencyManagement:
312313
assert.deepStrictEqual(actual, expected)
313314
})
314315

316+
it('WHEN showing plan statistics THEN correct labels appear', () => {
317+
const mockJobStatistics = [
318+
{
319+
name: 'linesOfCode',
320+
value: '1000',
321+
},
322+
{
323+
name: 'plannedDependencyChanges',
324+
value: '5',
325+
},
326+
{
327+
name: 'plannedDeprecatedApiChanges',
328+
value: '10',
329+
},
330+
{
331+
name: 'plannedFileChanges',
332+
value: '7',
333+
},
334+
]
335+
const result = getJobStatisticsHtml(mockJobStatistics)
336+
assert.strictEqual(result.includes('Lines of code in your application'), true)
337+
assert.strictEqual(result.includes('to be replaced'), false)
338+
assert.strictEqual(result.includes('to be changed'), false)
339+
})
340+
315341
it(`WHEN transforming a project with a Windows Maven executable THEN mavenName set correctly`, async function () {
316342
sinon.stub(env, 'isWin').returns(true)
317343
const tempFileName = 'mvnw.cmd'

0 commit comments

Comments
 (0)