diff --git a/packages/manager/.changeset/pr-11681-changed-1739908630049.md b/packages/manager/.changeset/pr-11681-changed-1739908630049.md new file mode 100644 index 00000000000..95db0b790c6 --- /dev/null +++ b/packages/manager/.changeset/pr-11681-changed-1739908630049.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Changed +--- + +Make "Public" checkbox default-checked in OAuth App creation form ([#11681](https://github.com/linode/manager/pull/11681)) diff --git a/packages/manager/cypress/e2e/core/account/oauth-apps.spec.ts b/packages/manager/cypress/e2e/core/account/oauth-apps.spec.ts index 5650f74dc9f..633eeb19ec4 100644 --- a/packages/manager/cypress/e2e/core/account/oauth-apps.spec.ts +++ b/packages/manager/cypress/e2e/core/account/oauth-apps.spec.ts @@ -101,8 +101,8 @@ const createOAuthApp = (oauthApp: OAuthClient) => { cy.findByLabelText('Callback URL').click(); cy.focused().clear(); cy.focused().type(oauthApp.redirect_uri); - // Check the 'public' checkbox - if (oauthApp.public) { + // Uncheck the 'public' checkbox + if (!oauthApp.public) { cy.get('[data-qa-checked]').should('be.visible').click(); } mockCreateOAuthApp(oauthApp).as('createOauthApp'); diff --git a/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.test.tsx b/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.test.tsx index 59d5955191f..427e594e19c 100644 --- a/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.test.tsx +++ b/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.test.tsx @@ -26,6 +26,14 @@ describe('Create API Token Drawer', () => { getByText('Create'); getByText('Cancel'); }); + it('Should have the Public checkbox as checked by default', () => { + const { getByRole } = renderWithTheme( + + ); + + const checkbox = getByRole('checkbox', { name: 'Public' }); + expect(checkbox).toBeChecked(); + }); it('Should show client side validation errors', async () => { const { getByText } = renderWithTheme( diff --git a/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.tsx b/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.tsx index 9b913d2ec1c..609afc73e76 100644 --- a/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.tsx +++ b/packages/manager/src/features/Profile/OAuthClients/CreateOAuthClientDrawer.tsx @@ -31,7 +31,7 @@ export const CreateOAuthClientDrawer = ({ const formik = useFormik({ initialValues: { label: '', - public: false, + public: true, redirect_uri: '', }, async onSubmit(values) {