-
Notifications
You must be signed in to change notification settings - Fork 110
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
test: add unit tests for getSchemaAppEnsuringOrganization #646
test: add unit tests for getSchemaAppEnsuringOrganization #646
Conversation
|
import type { clipToMaximum, fatalError } from '../../../../lib/util.js' | ||
import type { APICommand } from '../../../../lib/command/api-command.js' | ||
import type { chooseOrganization, organizationDef } from '../../../../lib/command/util/organizations-util.js' | ||
import { chooseOrganization, organizationDef } from '../../../../lib/command/util/organizations-util.js' |
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.
Here and on line 14 (import type { stdinIsTTY, stdoutIsTTY }...
) the import statement isn't what I expected with regard to type
and not type
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.
Yeah, I missed type
on a bunch of things here. Fixed now.
expect(cloneMock).not.toHaveBeenCalled() | ||
}) | ||
|
||
it('sets and organization when app found without an organization', async () => { |
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.
Little typo: "an organization"
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.
Good catch. Fixed.
it('sets and organization when app found without an organization', async () => { | ||
chooseOrganizationMock.mockResolvedValueOnce('organization-id-1') | ||
apiOrganizationsGetMock.mockResolvedValueOnce(organization1) | ||
// TODO: maybe use an "updated organization" here and in corresponding expect below |
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 checking: this TODO
is really for future work and not just an idea that you considered and rejected, right?
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.
Didn't mean to leave that in. Removed now.
7ebda67
to
f9c45de
Compare
getSchemaAppEnsuringOrganization
function.APICommand
(which already default toAPICommandFlags
).