mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Home app] Fix this
references (#110207)
* [Home app] Fix `this` references * More readable if
This commit is contained in:
parent
3cc7da8435
commit
7cfdd000ee
3 changed files with 13 additions and 4 deletions
|
@ -117,7 +117,7 @@ export class Home extends Component<HomeProps, State> {
|
|||
return this.props.directories.find((directory) => directory.id === id);
|
||||
}
|
||||
|
||||
getFeaturesByCategory(category: FeatureCatalogueCategory) {
|
||||
private getFeaturesByCategory(category: FeatureCatalogueCategory) {
|
||||
return this.props.directories
|
||||
.filter((directory) => directory.showOnHomePage && directory.category === category)
|
||||
.sort((directoryA, directoryB) => (directoryA.order ?? -1) - (directoryB.order ?? -1));
|
||||
|
@ -177,7 +177,7 @@ export class Home extends Component<HomeProps, State> {
|
|||
private renderWelcome() {
|
||||
return (
|
||||
<Welcome
|
||||
onSkip={this.skipWelcome}
|
||||
onSkip={() => this.skipWelcome()}
|
||||
urlBasePath={this.props.urlBasePath}
|
||||
telemetry={this.props.telemetry}
|
||||
/>
|
||||
|
|
|
@ -26,5 +26,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.common.navigateToUrl('home', undefined, { disableWelcomePrompt: false });
|
||||
expect(await PageObjects.home.isWelcomeInterstitialDisplayed()).to.be(true);
|
||||
});
|
||||
|
||||
it('clicking on "Explore on my own" redirects to the "home" page', async () => {
|
||||
await PageObjects.common.navigateToUrl('home', undefined, { disableWelcomePrompt: false });
|
||||
expect(await PageObjects.home.isWelcomeInterstitialDisplayed()).to.be(true);
|
||||
await PageObjects.common.clickAndValidate('skipWelcomeScreen', 'homeApp');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -487,7 +487,10 @@ export class CommonPageObject extends FtrService {
|
|||
topOffset?: number
|
||||
) {
|
||||
await this.testSubjects.click(clickTarget, undefined, topOffset);
|
||||
const validate = isValidatorCssString ? this.find.byCssSelector : this.testSubjects.exists;
|
||||
await validate(validator);
|
||||
if (isValidatorCssString) {
|
||||
await this.find.byCssSelector(validator);
|
||||
} else {
|
||||
await this.testSubjects.exists(validator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue