Skip to content

Commit 63c90fb

Browse files
committed
test(coverage): cmd-repository-create empty-visibility fallback to 'private'
1 parent 3a9021b commit 63c90fb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

packages/cli/test/unit/commands/repository/cmd-repository-create.test.mts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,23 @@ describe('cmd-repository-create', () => {
246246
)
247247
})
248248

249+
it('should default to private when --visibility is empty string', async () => {
250+
mockHasDefaultApiToken.mockReturnValueOnce(true)
251+
252+
await cmdRepositoryCreate.run(
253+
['test-repo', '--visibility=', '--no-interactive'],
254+
importMeta,
255+
context,
256+
)
257+
258+
expect(mockHandleCreateRepo).toHaveBeenCalledWith(
259+
expect.objectContaining({
260+
visibility: 'private',
261+
}),
262+
'text',
263+
)
264+
})
265+
249266
it('should pass --org flag to determineOrgSlug', async () => {
250267
mockDetermineOrgSlug.mockResolvedValueOnce(['custom-org', 'custom-org'])
251268
mockHasDefaultApiToken.mockReturnValueOnce(true)

0 commit comments

Comments
 (0)