Skip to content

Commit

Permalink
feat: added timeline icon to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
vickywane committed Mar 12, 2021
1 parent 7ce717f commit ba64ac2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 28 deletions.
64 changes: 37 additions & 27 deletions cypress/integration/ambianic-tests/navbar.spec.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
/// <reference types="cypress" />

context('Check Navbar Items', () => {
before(() => {
cy.visit('http://localhost:8080')
cy.get('[data-cy=timeline]').click()
})
before(() => {
cy.visit('http://localhost:8080')
cy.get('[data-cy=timeline]').click()
})

it('Should have a search bar', () => {
cy.get('[data-cy=container').find("#searchbar")
})
it('Should have a search bar', () => {
cy.get('[data-cy=container').find("#searchbar")
})

it('Should be a download off button', () => {
const t = cy.get('[data-cy=download-off]')
expect(t).to.exist
})
it('Should be a download off button', () => {
const t = cy.get('[data-cy=download-off]')
expect(t).to.exist
})

it('Should be a heart button', () => {
const t = cy.get('[data-cy=heart]')
expect(t).to.exist
})
it('Should be a heart button', () => {
const t = cy.get('[data-cy=heart]')
expect(t).to.exist
})

it('Should be a bell button', () => {
const t = cy.get('[data-cy=bell]')
expect(t).to.exist
})
it('Should be a bell button', () => {
const t = cy.get('[data-cy=bell]')
expect(t).to.exist
})

it('Should be an about button', () => {
const t = cy.get('[data-cy=about]')
expect(t).to.exist
})
it('Should be an about button', () => {
const t = cy.get('[data-cy=about]')
expect(t).to.exist
})

it('Should have a five links', () => {
cy.get('[data-cy=drawer]').then(($result) => {
assert.equal($result.children().children()[0].childElementCount,5,'Five links in the drawer')
})
it('Should have a five links', () => {
cy.get('[data-cy=drawer]').then(($result) => {
assert.equal($result.children().children()[0].childElementCount,5,'Five links in the drawer')
})
})

it('Should have a clickable timeline icon', () => {
const icon = cy.get('[data-cy=timeline-icon]')

icon.should("be.visible")

icon.click()

cy.url().should('include', '/timeline')
})
})
9 changes: 9 additions & 0 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
/>
<v-spacer />

<amb-button
data-cy="timeline-icon"
id="timeline-icon"
is-icon
icon="history"
btn-color="secondary"
to="timeline"
/>

<amb-button
with-badge
data-cy="download-off"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/navbar/navbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('NavBar', () => {

test('should load 5 buttons', () => {
const btn = wrapper.findAll('.v-btn')
expect(btn.length).toBe(5)
expect(btn.length).toBe(6)
})

test('should load navigation drawer', () => {
Expand Down

0 comments on commit ba64ac2

Please sign in to comment.