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

Refactor route definition - Closes #499 #542

Merged
merged 5 commits into from
Mar 13, 2018

Conversation

michaeltomasik
Copy link
Contributor

What was the problem?

Some routes definitions were in the string

How did I fix it?

Created constants for route

How to test it?

Search for main and explorer to check if route definition comes from one file

Review checklist

dashboard: { url: '/dashboard' },
search: { url: '/search' },
searchResult: { url: '/result' },
transaction: { url: '/transactions' },
Copy link
Contributor

@yasharAyari yasharAyari Mar 12, 2018

Choose a reason for hiding this comment

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

why did you remove short routes ?

@@ -85,18 +86,18 @@ describe('Login', () => {
});

describe('History management', () => {
it('calls this.props.history.replace(\'/main/dashboard\')', () => {
it(`calls this.props.history.replace('${routes.main}${routes.dashboard.url}')`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the it blocks with descriptions that are more readable (as you were already changing them anyway). We want to avoid exactly the situation that you were in here, where when we change some implementation, the describe blocks have to be updated too. Instead, by having a general readable description of what we are expecting, there will be no need to always update the blocks. So one possible example could be, instead of
calls this.props.history.replace('${routes.main}${routes.dashboard.url}') -> redirects to dashboard

params: 'query',
name: 'result',
}, {
regex: /\/explorer\/search(?:\/[^/]*)?$/,
path: `${routes.search.long}/`,
path: `/explorer${routes.search.url}/`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not ${routes.explorer} instead of /explorer?

@michaeltomasik michaeltomasik changed the base branch from development to 0.3.0 March 12, 2018 16:36
@michaeltomasik michaeltomasik force-pushed the 499-refactor-route-definitions branch from 25ef2ae to abb5f11 Compare March 13, 2018 13:38
@michaeltomasik michaeltomasik merged commit 4914587 into 0.3.0 Mar 13, 2018
@michaeltomasik michaeltomasik deleted the 499-refactor-route-definitions branch March 13, 2018 16:16
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