-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds command flow recyclebinitem list
#6214
base: main
Are you sure you want to change the base?
Conversation
998e9fd
to
4b24a23
Compare
4b24a23
to
40a1617
Compare
flow recyclebinitem list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments in your tests. Could you have a look at those?
|
||
describe(commands.OWNER_LIST, () => { | ||
const environmentName = 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this empty line
it('correctly retrieves deleted flows with output json', async () => { | ||
sinon.stub(request, 'get').callsFake(async (opts) => { | ||
if (opts.url === `https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/${formatting.encodeQueryParameter(environmentName)}/v2/flows?api-version=2016-11-01&include=softDeletedFlows`) { | ||
return flowResponse; | ||
} | ||
|
||
throw 'Invalid request'; | ||
}); | ||
|
||
await command.action(logger, { options: { verbose: true, environmentName: environmentName } }); | ||
assert.deepStrictEqual(loggerLogSpy.firstCall.args[0], deletedFlows); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we combine this assert with the first json test? Now we are doing the exact same
it('correctly retrieves deleted flows with output text', async () => { | ||
sinon.stub(request, 'get').callsFake(async (opts) => { | ||
if (opts.url === `https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/${formatting.encodeQueryParameter(environmentName)}/v2/flows?api-version=2016-11-01&include=softDeletedFlows`) { | ||
return flowResponse; | ||
} | ||
|
||
throw 'Invalid request'; | ||
}); | ||
|
||
await command.action(logger, { options: { verbose: true, environmentName: environmentName, output: 'text' } }); | ||
const textResponse = deletedFlows.map(flow => ({ ...flow, displayName: flow.properties.displayName })); | ||
|
||
assert.deepStrictEqual(loggerLogSpy.firstCall.args[0], textResponse); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we combine this assert with the first text test? Now we are doing the exact same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to merge 2 tests? They are doing the same indeed but testing something different. AFAIK, in an ideal world, a test should have only 1 assert, so it checks exactly 1 thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job. Will merge soon.
Closes #6139