-
Notifications
You must be signed in to change notification settings - Fork 2
Exercise7 #9
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
base: main
Are you sure you want to change the base?
Exercise7 #9
Conversation
30ddd25 to
872052b
Compare
a14ada0 to
fc6da80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could find at least six stars: ⭐ ⭐⭐ ⭐⭐ ⭐
However there is still missing
- PWA configuration
| @@ -0,0 +1,111 @@ | |||
| <template> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ⭐ ⭐
For a login feature in your webapp including a Vue component...
| @@ -0,0 +1,275 @@ | |||
| import '@testing-library/jest-dom' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, those two ⭐ ⭐ belong to the LoginForm component. Great that you wrote corresponding
...software tests.
| @@ -0,0 +1,34 @@ | |||
| <template> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woho, two ⭐ ⭐
For a menu component which shows a login or logout button ...
| @@ -0,0 +1,137 @@ | |||
| import '@testing-library/jest-dom' | |||
| import 'regenerator-runtime' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up for those
software tests
of the menu component with its login and logout buttons. Now the two ⭐ ⭐ are fully earned!
|
|
||
| ``` | ||
| $ (webapp) npm run build | ||
| ``` | ||
|
|
||
| ### Compiles and minifies for production (static build) | ||
|
|
||
| ``` | ||
| $ (webapp) npm run generate | ||
| ``` | ||
|
|
||
| ### Serve in production | ||
|
|
||
| ``` | ||
| $ (webapp) npm run start | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Another ⭐
For instructions in the README.md on how to build your webapp for production.
| <template v-if="isAuthenticated && userId === authorId"> | ||
| <button disabled title="Not implemented yet">Edit</button> | ||
| <button @click="$emit('remove')">Remove</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Another ⭐
For a delete and edit button that is only visible to the author of the post.
| :disabled="!isAuthenticated || userVote > 0" | ||
| :title="isAuthenticated ? null : 'Login to upvote'" | ||
| @click="$emit('upvote')" | ||
| > | ||
| Upvote | ||
| </button> | ||
| <button | ||
| :disabled="!isAuthenticated || userVote < 0" | ||
| :title="isAuthenticated ? null : 'Login to downvote'" | ||
| @click="$emit('downvote')" | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome as usual!
A final ⭐
For an upvote button that behaves according to the authentication state of your user
| // Build Configuration: https://go.nuxtjs.dev/config-build | ||
| build: { | ||
| } | ||
| build: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Maybe I am overlooking something, but I guess PWA is still missing.
Remember to catch your ⭐
For Lighthouse reporting that your production website is installable as PWA (except HTTPS).
roschaefer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! You received all 13/13 ⭐ in this submission. Congrats!
I really like that you wrote these storybooks. In my opinion, they really help to develop highly reusable and accessible components.
I would strongly suggest that give up the "should" in your test case description. It's just unnecessary.
⭐ For instructions in the README.md on how to build your webapp for production.
⭐ For no changes in "Files Changed" tab of the refactoring from vue-cli to create-nuxt-app. (See #1 in instructions)
⭐ ⭐ For the API connection between your front- and backend.
⭐ For your previous frontend tests still passing. Requests to the backend are mocked.
⭐ ⭐ For a login feature in your webapp including a Vue component and its software tests.
⭐ ⭐ For a menu component which shows a login or logout button and its software tests.
⭐ For an upvote button that behaves according to the authentication state of your user
⭐ For a delete and edit button that is only visible to the author of the post.
⭐ For Lighthouse reporting that your production website is installable as PWA (except HTTPS).
⭐ For requesting a review and reviewing another team's PR.
See my sugestions below.
| branches: [ main, exercise7 ] | ||
| pull_request: | ||
| branches: [ main, exercise3 ] | ||
| branches: [ main, exercise7 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about testing all branches?
| ``` | ||
|
|
||
| ### Run linter | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small typo further down this file 👇
$ docker run -p 7474:7474 -p 7687:7687 --env=NEO4J_AUTH=$NEO4J_USERNAME/$NEO4J_PASSWORD neo4j:4.2.1
Missing $
| ### Compiles and minifies for production (static build) | ||
|
|
||
| ``` | ||
| $ (webapp) npm run generate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running npm run generate fails with the following erros:
ERROR /index.stories 15:26:50
Error: render function or template not defined in component: anonymous
at Qi (/home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:66721)
at io (/home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:70594)
at ro (/home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:70244)
at eo (/home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:67491)
at /home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:70711
at runNextTicks (internal/process/task_queues.js:58:5)
at listOnTimeout (internal/timers.js:523:9)
at processTimers (internal/timers.js:497:7)
ERROR / 15:26:50
TypeError: Cannot read property 'length' of undefined
at a.render (pages/index.vue?1e15:1:0)
at a.t._render (/home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue/dist/vue.runtime.common.prod.js:6:35273)
at /home/robert/Development/Systems-Development-and-Frameworks/homework/webapp/node_modules/vue-server-renderer/build.prod.js:1:70637
According to your .nuxt.config.js your deployment target is server. Please only include relevant deployment instructions in your README.md.
| background: '#ececec', | ||
| theme_color: '#0083e3', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ For Lighthouse reporting that your production website is installable as PWA (except HTTPS).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's installable for me with npm run build and npm run start 😅
| '@storybook/addon-a11y', | ||
| '@storybook/addon-links', | ||
| ] | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you could have excluded this refactoring from the PR diff.
| await createLoginForm() | ||
| await wrapper.vm.$nextTick() | ||
|
|
||
| expect(wrapper.find('#form-login').element).not.toBeEmptyDOMElement() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest the assertions provided by vue-test-utils.
| expect(wrapper.html()).toMatchSnapshot() | ||
| }) | ||
|
|
||
| it('should only enable the submit button if both email and password are provided', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it('should only enable the submit button if both email and password are provided', async () => { | |
| it('only enables the submit button if both email and password are provided', async () => { |
Be affirmative.
| await wrapper.vm.$nextTick() | ||
|
|
||
| expect(loginButton).toBeDisabled() | ||
|
|
||
| wrapper.find('#input-password').setValue('someSecret') | ||
| await wrapper.vm.$nextTick() | ||
|
|
||
| expect(loginButton).toBeEnabled() | ||
|
|
||
| wrapper.find('#input-password').setValue('') | ||
| await wrapper.vm.$nextTick() | ||
|
|
||
| expect(loginButton).toBeDisabled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to have one expectation per test-case for readability and to avoid false-negatives (because of state altered in some special order). You can split this into multiple test cases and use beforeEach for a shared setup.
| expect(wrapper.html()).toMatchSnapshot() | ||
| }) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐ ⭐ For a login feature in your webapp including a Vue component and its software tests.
| }) | ||
| }) | ||
| }) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐ ⭐ For a menu component which shows a login or logout button and its software tests.
|
Thanks a lot for the thorough review, @roschaefer !
I consider the tests as a set of specifications that the implementation(s) should fulfill (as in BDD) - in that sense, the word "should" (or "must") is part of the specification (or legal) lingo. |


My review was for lichtow!