Skip to content

Commit

Permalink
Merge branch 'main' into fix-channel-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
riysaxen-amzn authored Aug 5, 2024
2 parents 8ebc163 + 77b4d19 commit c90e0d6
Showing 1 changed file with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ describe('Aliases', () => {

describe('can flush an alias', () => {
it('successfully flush an index', () => {
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-${1}`;
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-1`;
// Sort all aliases in asc order to make it at first page
cy.contains('Alias name').click();
cy.get('[placeholder="Search..."]').type(`${sample_alias}{enter}`);
// Confirm we have our initial alias
cy.contains(sample_alias);
// index a test doc
Expand All @@ -170,28 +170,20 @@ describe('Aliases', () => {
expect(num).to.equal(1);
});

cy.get('[data-test-subj="moreAction"]').click();
// Flush btn should be disabled if no items selected
cy.get('[data-test-subj="Flush Action"]').should(
'have.class',
'euiContextMenuItem-isDisabled'
);

// Select an alias
cy.get(`[data-test-subj="checkboxSelectRow-${sample_alias}"]`).check({
force: true,
});

cy.get('[data-test-subj="moreAction"]').click();

// Extra wait required for page data to load, otherwise "Enable" button will be disabled
cy.wait(2000);
cy.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('be.disabled')
.end();

// Flush btn should be enabled
cy.get('[data-test-subj="Flush Action"]')
.should('exist')
.should('not.have.class', 'euiContextMenuItem-isDisabled')
.click();
cy.get(`#_selection_column_${sample_alias}-checkbox`)
.click()
.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('not.be.disabled')
.click()
.end();

// Check for flush index modal
cy.contains('Flush alias');
Expand Down

0 comments on commit c90e0d6

Please sign in to comment.