Skip to content

Commit e7d8c8d

Browse files
ref(settings): Remove unreachable mutation.isSuccess disable
The success modal blocks interaction and closing it navigates away, so the button can never be clicked after success. Remove the dead code and its test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ceb5a00 commit e7d8c8d

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

static/app/views/settings/account/apiNewToken.spec.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -170,28 +170,6 @@ describe('ApiNewToken', () => {
170170
);
171171
});
172172

173-
it('disables create button after successful creation', async () => {
174-
MockApiClient.clearMockResponses();
175-
MockApiClient.addMockResponse({
176-
method: 'POST',
177-
url: '/api-tokens/',
178-
body: ApiTokenFixture({token: 'sntrys_test_token_123'}),
179-
});
180-
181-
render(<ApiNewToken />);
182-
renderGlobalModal();
183-
184-
await selectEvent.select(screen.getByRole('textbox', {name: 'Project'}), 'Read');
185-
186-
const createButton = screen.getByRole('button', {name: 'Create Token'});
187-
expect(createButton).toBeEnabled();
188-
189-
await userEvent.click(createButton);
190-
191-
expect(await screen.findByLabelText('Generated token')).toBeInTheDocument();
192-
expect(createButton).toBeDisabled();
193-
});
194-
195173
it('displays permissions preview when scopes are selected', async () => {
196174
render(<ApiNewToken />);
197175

static/app/views/settings/account/apiNewToken.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export default function ApiNewToken() {
167167
</Panel>
168168
<Flex justify="end" gap="md" padding="md">
169169
<Button onClick={handleGoBack}>{t('Cancel')}</Button>
170-
<form.SubmitButton disabled={mutation.isSuccess || allPermissionsNoAccess}>
170+
<form.SubmitButton disabled={allPermissionsNoAccess}>
171171
{t('Create Token')}
172172
</form.SubmitButton>
173173
</Flex>

0 commit comments

Comments
 (0)