Skip to content

Commit

Permalink
fix glossary column dropdown drag drop integration test (open-metadat…
Browse files Browse the repository at this point in the history
  • Loading branch information
shrushti2000 authored Nov 17, 2024
1 parent 88c8fb4 commit 5cdde20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
Expand Down

0 comments on commit 5cdde20

Please sign in to comment.