Skip to content

Commit

Permalink
Remove the logo and run Cypress in debug mod
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed Mar 9, 2020
1 parent 425d0b3 commit e5e540d
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ script:
- npm install -g wait-on
- npm run build
- npm start & wait-on http://localhost:8080
- npm run test
- npm run test-debug

after_success:
- cd $GOPATH/src/app
Expand Down
79 changes: 0 additions & 79 deletions src/app/ui/components/Logo.vue

This file was deleted.

58 changes: 58 additions & 0 deletions src/app/ui/components/menu.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<nav class="navbar is-black" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<nuxt-link class="navbar-item" to="/" data-cy="home-link">
<strong>govueapp</strong>
</nuxt-link>

<button class="button navbar-burger">
<span />
<span />
<span />
</button>
</div>

<div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Menu
</a>

<div class="navbar-dropdown is-right">
<nuxt-link class="navbar-item" to="/login">
Login
</nuxt-link>
<nuxt-link class="navbar-item" to="/about">
About
</nuxt-link>
<hr class="navbar-divider" />
<a v-if="isAuthenticated" class="dropdown-item" @click="logout"
>Logout</a
>
<div class="navbar-item">
v0.5.0
</div>
</div>
</div>
</div>
</nav>
</template>

<script>
import { mapGetters } from 'vuex'
const Cookie = process.client ? require('js-cookie') : undefined
export default {
name: 'Menu',
computed: {
...mapGetters(['isAuthenticated'])
},
methods: {
logout() {
Cookie.remove('auth')
this.$store.commit('setAuth', null)
this.$router.push('/login')
}
}
}
</script>
54 changes: 54 additions & 0 deletions src/app/ui/components/note.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<li>
<div class="box">
<div class="content">
<div class="editable">
<input
:id="id"
v-model="imessage"
type="text"
class="input individual-note"
@keyup="$emit('edit', index, id, imessage)"
/>
</div>
</div>
<nav class="level is-mobile">
<div class="level-left">
<a class="level-item">
<span class="icon is-small has-text-danger">
<i
class="fa fa-trash-o"
data-cy="delete-note-link"
@click="$emit('remove', index, id)"
></i>
</span>
</a>
</div>
</nav>
</div>
</li>
</template>

<script>
export default {
props: {
index: {
type: Number,
required: true
},
id: {
type: String,
required: true
},
message: {
type: String,
required: true
}
},
data() {
return {
imessage: this.message
}
}
}
</script>
2 changes: 1 addition & 1 deletion src/app/ui/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>

<script>
import Menu from '~/components/Menu.vue'
import Menu from '~/components/menu.vue'
export default {
components: {
Expand Down
1 change: 1 addition & 0 deletions src/app/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint",
"test": "cypress run",
"test-debug": "DEBUG=cypress:* cypress run",
"cypress": "cypress open"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/app/ui/pages/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div>
<ul id="listTodo">
<li
is="Note"
is="note"
v-for="(v, k) in todolist"
:id="v.id"
:key="v.id"
Expand All @@ -36,11 +36,11 @@
</template>

<script>
import Note from '~/components/Note.vue'
import note from '~/components/note.vue'
export default {
components: {
Note
note
},
data() {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/test/e2e/integration/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ describe('test the basic functionality', function() {
.should('have.value', 'a')

cy.get('[data-cy=submit]').click()

cy.visit('/')
})

it('login with the user', function() {
cy.visit('/')

cy.contains('Login')
cy.url().should('include', '/')

Expand Down

0 comments on commit e5e540d

Please sign in to comment.