Skip to content

Commit 0751254

Browse files
committed
admin: fix doc integration
1 parent f255a1c commit 0751254

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

static/gsAdmin/views/docIntegrations.spec.tsx

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,11 @@ describe('Doc Integration Details', function () {
9292
await screen.findByRole('heading', {name: 'Doc Integrations'})
9393
).toBeInTheDocument();
9494

95-
const button = screen.getByTestId('detail-actions');
96-
expect(button).toHaveAttribute('aria-expanded', 'false');
97-
await userEvent.click(button);
98-
expect(button).toHaveAttribute('aria-expanded', 'true');
95+
await userEvent.click(await screen.findByText('Doc Integrations Actions'));
9996

100-
const deleteButton = screen.getByRole('option', {
101-
name: 'Delete Doc Integration 🚨 Delete this Doc Integration FOREVER (irreversible) 🚨',
102-
});
97+
const deleteButton = await screen.findByText(
98+
/Delete this Doc Integration FOREVER \(irreversible\)/
99+
);
103100

104101
expect(deleteButton).toBeEnabled();
105102
await userEvent.click(deleteButton);
@@ -150,16 +147,13 @@ describe('Doc Integration Details', function () {
150147
await screen.findByRole('heading', {name: 'Doc Integrations'})
151148
).toBeInTheDocument();
152149

153-
const button = screen.getByTestId('detail-actions');
154-
expect(button).toHaveAttribute('aria-expanded', 'false');
150+
const button = await screen.findByText('Doc Integrations Actions');
155151
await userEvent.click(button);
156-
expect(button).toHaveAttribute('aria-expanded', 'true');
157152

158-
const deleteButton = screen.getByRole('option', {
159-
name: 'Delete Doc Integration 🚨 Delete this Doc Integration FOREVER (irreversible) 🚨',
160-
});
153+
const deleteButton = await screen.findByText(
154+
/Delete this Doc Integration FOREVER \(irreversible\)/
155+
);
161156

162-
expect(deleteButton).toBeEnabled();
163157
await userEvent.click(deleteButton);
164158

165159
renderGlobalModal();
@@ -208,16 +202,12 @@ describe('Doc Integration Details', function () {
208202
await screen.findByRole('heading', {name: 'Doc Integrations'})
209203
).toBeInTheDocument();
210204

211-
const button = screen.getByTestId('detail-actions');
212-
expect(button).toHaveAttribute('aria-expanded', 'false');
213-
await userEvent.click(button);
214-
expect(button).toHaveAttribute('aria-expanded', 'true');
205+
await userEvent.click(await screen.findByText('Doc Integrations Actions'));
215206

216-
const unpublishButton = screen.getByRole('option', {
217-
name: 'Unpublish App Revert This Doc Integration to Draft Mode',
218-
});
207+
const unpublishButton = await screen.findByText(
208+
'Revert This Doc Integration to Draft Mode'
209+
);
219210

220-
expect(unpublishButton).toBeEnabled();
221211
await userEvent.click(unpublishButton);
222212

223213
expect(indicators.addSuccessMessage).toHaveBeenCalledWith(

0 commit comments

Comments
 (0)