Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/better 404 page handling #189

Merged
merged 17 commits into from
Aug 10, 2020
Merged

Conversation

StyleT
Copy link
Contributor

@StyleT StyleT commented Aug 3, 2020

No description provided.

@StyleT StyleT marked this pull request as ready for review August 6, 2020 14:34

//region 404 page for non-existing News resource
Scenario('Renders (SSR) global 404 page for non-existing News resource', (I) => {
I.amOnPage('/news/article/abc-news-au34');
Copy link
Contributor

@nightnei nightnei Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose:

  1. to move all urls to config injectors(eg e2e/spec/pages/news.ts)
  2. and inside those files create 2 objects: urls and selectors

I think it's more obviously and ease to read tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some refactoring with news urls, pls take a look.
I think we need a separate PR for more refactoring around this topic.

@StyleT StyleT requested a review from nightnei August 7, 2020 11:13
document.removeEventListener('click', this.#onClickLink);
}

#onSingleSpaRoutingEvents = () => {
this.#prevRoute = this.#currentRoute;

const newUrl = this.#getCurrUrl();
if (this.#forceSpecialRoute !== null && this.#forceSpecialRoute.url === newUrl) {
this.#currentRoute = this.#router.matchSpecial(newUrl, this.#forceSpecialRoute.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reset "#forceSpecialRoute" immediately after using it here?
Why we should do it in separate else if?

};

#getIlcState = (request) => {
const state = request.ilcState || {};
Copy link
Contributor

@oleh-momot oleh-momot Aug 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand when we would not have ilcState
Because I see ilcState is always expected here is ilc/server/tailor/error-handler.js line 16 and it would be added to the request here is ilc/server/app.js line 30


Scenario('Renders (SSR) overridden 404 page for non-existing News resource', (I, newsPage: newsPage) => {
I.amOnPage(newsPage.url.nonExistingResourceWithOverride);
I.waitForText('404 not found component', 1000, 'body > div#body');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we exactly need to wait here for 1000 seconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


//region 404 page for non-existing News app route
Scenario('Renders (SSR) global 404 page for non-existing News app route', (I) => {
I.amOnPage('/news/nonExisting');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you added URLs here is e2e/spec/pages/news.ts
So you can use newsPage.url.nonExistingRoute here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@StyleT StyleT requested a review from oleh-momot August 10, 2020 12:58
@StyleT StyleT merged commit b945f79 into master Aug 10, 2020
@StyleT StyleT deleted the feature/better_404_page_handling branch August 10, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants