Skip to content

Conversation

@jobegrabber
Copy link
Collaborator

@jobegrabber jobegrabber commented Jan 25, 2021

My review was for lichtow!

@jobegrabber jobegrabber requested review from noeljns and powlaa January 26, 2021 00:24
Base automatically changed from move-to-nuxt to main January 26, 2021 17:26
Copy link

@noeljns noeljns left a 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>
Copy link

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'
Copy link

@noeljns noeljns Jan 26, 2021

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>
Copy link

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'
Copy link

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!

Comment on lines 32 to +48

```
$ (webapp) npm run build
```

### Compiles and minifies for production (static build)

```
$ (webapp) npm run generate
```

### Serve in production

```
$ (webapp) npm run start
```

Copy link

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.

Comment on lines +18 to +20
<template v-if="isAuthenticated && userId === authorId">
<button disabled title="Not implemented yet">Edit</button>
<button @click="$emit('remove')">Remove</button>
Copy link

@noeljns noeljns Jan 26, 2021

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.

Comment on lines +5 to +15
: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')"
>
Copy link

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: {},
Copy link

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).

@jobegrabber
Copy link
Collaborator Author

I could find at least six stars:

However there is still missing

  • PWA configuration

Thanks a lot for the review, very much appreciated!
My PWA configuration is here 😃 (reference)

@jobegrabber jobegrabber requested review from a team, medizinmensch and roschaefer February 1, 2021 00:10
Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

party

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 ]
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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',
},
},
Copy link
Contributor

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).

Swappshot Sat Feb 13 15:29:14 2021

Copy link
Collaborator Author

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',
]
})
Copy link
Contributor

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()
Copy link
Contributor

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 () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines +91 to +103
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()
Copy link
Contributor

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()
})
})
})
Copy link
Contributor

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.

})
})
})

Copy link
Contributor

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.

@jobegrabber
Copy link
Collaborator Author

Thanks a lot for the thorough review, @roschaefer !

I would strongly suggest that give up the "should" in your test case description. It's just unnecessary.

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.
Ultimately, as many a thing, this is up for personal preference of course.

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.

4 participants