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, browser,
}) => { }) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser); const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary(); const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1); const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1); glossary1.data.terms = [glossaryTerm1];
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
try { try {
await glossary1.create(apiContext); await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext); await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY); await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName); await selectActiveGlossary(page, glossary1.data.displayName);
await openColumnDropdown(page); await openColumnDropdown(page);
const dragColumn = 'Owners'; const dragColumn = 'Owners';
const dropColumn = 'Status'; const dropColumn = 'Status';
await dragAndDropColumn(page, dragColumn, dropColumn); await dragAndDropColumn(page, dragColumn, dropColumn);
const saveButton = page.locator('.ant-btn-primary', { const saveButton = page.locator(
hasText: 'Save', '[data-testid="glossary-col-dropdown-save"]'
}); );
await saveButton.click(); await saveButton.click();
await page.waitForSelector('thead th', { state: 'visible' });
const columnHeaders = await page.locator('thead th'); const columnHeaders = await page.locator('thead th');
const columnText = await columnHeaders.allTextContents(); const columnText = await columnHeaders.allTextContents();
expect(columnText).toEqual([ expect(columnText).toEqual(
'Terms', columnText.includes('Actions')
'Description', ? ['Terms', 'Description', 'Status', 'Owners', 'Actions']
'Status', : ['Terms', 'Description', 'Status', 'Owners']
'Owners', );
'Actions',
]);
} finally { } finally {
await glossaryTerm1.delete(apiContext); await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossary1.delete(apiContext); await glossary1.delete(apiContext);
await afterAction(); await afterAction();
} }

View File

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