-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Miki <[email protected]>
- Loading branch information
Showing
3 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ss/integration/core-opensearch-dashboards/opensearch-dashboards/apps/home/section.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('home sections', { scrollBehavior: false }, () => { | ||
before(() => { | ||
// Go to the home page | ||
miscUtils.visitPage('app/home#'); | ||
}); | ||
|
||
it('should all appear expanded', function () { | ||
cy.getElementsByTestIds('homepageSection').each((element) => { | ||
const $content = element.find( | ||
'[data-test-subj="homepageSectionContent"]' | ||
); | ||
expect($content).to.have.length(1); | ||
}); | ||
}); | ||
|
||
it('should toggle correctly', function () { | ||
cy.getElementsByTestIds('homepageSection').each((element) => { | ||
const $button = element.find('button').first(); | ||
|
||
const $preClick1 = element.find( | ||
'[data-test-subj="homepageSectionContent"]' | ||
); | ||
expect($preClick1).to.have.length(1); | ||
|
||
$button.trigger('click'); | ||
|
||
const $postClick1 = element.find( | ||
'[data-test-subj="homepageSectionContent"]' | ||
); | ||
expect($postClick1).to.have.length(0); | ||
|
||
$button.trigger('click'); | ||
|
||
const $postClick2 = element.find( | ||
'[data-test-subj="homepageSectionContent"]' | ||
); | ||
expect($postClick2).to.have.length(1); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters