fix glossary column dropdown drag drop integration test (#18662)

This commit is contained in:
Shrushti Polekar 2024-11-17 21:44:33 +05:30 committed by GitHub
parent 88c8fb48f3
commit 5cdde2054b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 16 deletions

View File

@ -1027,42 +1027,37 @@ test.describe('Glossary tests', () => {
}
});
test.skip('Column dropdown drag-and-drop functionality for Glossary Terms table', async ({
test('Column dropdown drag-and-drop functionality for Glossary Terms table', async ({
browser,
}) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
glossary1.data.terms = [glossaryTerm1];
try {
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await openColumnDropdown(page);
const dragColumn = 'Owners';
const dropColumn = 'Status';
await dragAndDropColumn(page, dragColumn, dropColumn);
const saveButton = page.locator('.ant-btn-primary', {
hasText: 'Save',
});
const saveButton = page.locator(
'[data-testid="glossary-col-dropdown-save"]'
);
await saveButton.click();
await page.waitForSelector('thead th', { state: 'visible' });
const columnHeaders = await page.locator('thead th');
const columnText = await columnHeaders.allTextContents();
expect(columnText).toEqual([
'Terms',
'Description',
'Status',
'Owners',
'Actions',
]);
expect(columnText).toEqual(
columnText.includes('Actions')
? ['Terms', 'Description', 'Status', 'Owners', 'Actions']
: ['Terms', 'Description', 'Status', 'Owners']
);
} finally {
await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}

View File

@ -498,6 +498,7 @@ const GlossaryTermTab = ({
<Space>
<Button
className="custom-glossary-dropdown-action-btn"
data-testid="glossary-col-dropdown-save"
type="primary"
onClick={handleColumnSelectionDropdownSave}>
{t('label.save')}