Skip to content

Commit

Permalink
feat: Adjusted return users flow to navigate to timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
vickywane committed Jan 31, 2021
1 parent 56d71e9 commit c8c4877
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16,147 deletions.
2 changes: 0 additions & 2 deletions cypress/integration/ambianic-tests/about.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ context('AboutPage', () => {
})

it('Loads title and subtitle', () => {

cy.get('#about-title > .v-list-item__content > .v-list-item__title')
.should('contain.text', 'Cozy at Home')

Expand All @@ -31,5 +30,4 @@ context('AboutPage', () => {
cy.get('#version-info > .v-list-item__content > .v-list-item__subtitle')
.should('contain.text', 'Release Version')
})

})
39 changes: 27 additions & 12 deletions cypress/integration/ambianic-tests/home.spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
/// <reference types="cypress" />
import {CHANGE_REMOTE_PEER_ID} from '../../../src/store/action-types';

context('HomePage', () => {
beforeEach(() => {
cy.visit('/')
})
beforeEach(() => {
cy.visit('/')
})

it('Loads title and subtitle', () => {
cy.get('.v-list-item__subtitle')
.should('contain.text', 'Cozy at Home - via Ambient Intelligence')
})

it('Loads firsttime installation button', () => {
cy.get('#btn-timeline > .v-btn__content')
.should('contain.text', 'Continue Setup')
.click()
})

it('Ensures returning users are taken directly to timeline', () => {
cy.window().should('have.property', '__store__')
cy.window().then(win => {
win.__store__.dispatch(CHANGE_REMOTE_PEER_ID, '917d5f0a-6469-4d33-b5c2-efd858118b74')
cy.wait(1000)

it('Loads title and subtitle', () => {
cy.get('.v-list-item__subtitle')
.should('contain.text', 'Cozy at Home - via Ambient Intelligence')
})
// reload to use new values for testing
cy.reload()

it('Loads firsttime installation button', () => {
cy.get('#btn-timeline > .v-btn__content')
.should('contain.text', 'Continue Setup')
.click()
})
cy.url().should('include', '/timeline')
})
})
})
2 changes: 1 addition & 1 deletion cypress/integration/ambianic-tests/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ context("Onboarding", () => {
cy.get("[data-cy=request-access]").click();

cy.get("[data-cy=send-message]").click();
cy.get("[data-cy=select-client]").click();
cy.get("[data-cy=select-client]").click('');
});

it("Should have PeerID input field and enabled Submit button after validation", () => {
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ new Vue({
vuetify,
render: h => h(App)
}).$mount('#app')

if (window.Cypress) {
window.__store__ = store
}
20 changes: 1 addition & 19 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@

<v-card-actions class="align-center">
<div
v-if="hasSetupSystem"
class="skip-link"
>
<v-btn
rounded
color="pink darken-4"
dark
data-cy="timeline"
class="ma-2 white--text"
:to="'timeline'"
id="btn-timeline"
>
Open Edge Console
</v-btn>
</div>

<div
v-else
class="skip-link"
>
<v-btn
Expand Down Expand Up @@ -121,7 +103,7 @@ export default {
const remotePeerId = this.edgePeerId
if (setupStatus || remotePeerId) {
this.hasSetupSystem = true
this.$router.push('timeline')
}
}
}
Expand Down
Loading

0 comments on commit c8c4877

Please sign in to comment.