[Home app] Fix this references (#110207) (#110244)

* [Home app] Fix `this` references

* More readable if

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
This commit is contained in:
Kibana Machine 2021-08-26 12:43:35 -04:00 committed by GitHub
parent 8875ce2a9a
commit cd5459a2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -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}
/>

View file

@ -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');
});
});
}