Skip to content

Commit

Permalink
feat: show timeline button in device settings when connected
Browse files Browse the repository at this point in the history
Signed-off-by: ivelin <ivelin@ambianic.ai>
  • Loading branch information
ivelin committed Apr 18, 2022
1 parent 80d28f8 commit cf3ab61
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 48 deletions.
11 changes: 10 additions & 1 deletion cypress/integration/ambianic-tests/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ context('Settings', () => {
cy.get('[data-cy=mydevices-btn]').contains('My Devices')
})

it('Should display edge device peer ID', () => {
it('Should have Timeline button after connecting', () => {
cy.window().then(win => {
cy.get('[data-cy=timeline-btn]').should('not.exist').then( ($el) => {
_fakeConnect(cy, win)
cy.get('[data-cy=timeline-btn]').should('exist').contains('Timeline')
})
})
})

it('Should display edge device peer ID after connecting', () => {
cy.window().then(win => {
cy.get('[data-cy=list-item-edgePeerID]').should('not.exist').then( ($el) => {
_fakeConnect(cy, win)
Expand Down
62 changes: 17 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"idb": "^6.1.4",
"konva": "^8.3",
"moment": "^2.29",
"node": "^16.10.0",
"peerjs": "^1.3.2",
"register-service-worker": "^1.7.1",
"sjcl": "^1.0.8",
Expand Down Expand Up @@ -93,7 +92,7 @@
"webpack-bundle-analyzer": "^4.5"
},
"engines": {
"node": ">=14"
"node": ">=16"
},
"funding": {
"type": "github",
Expand Down
7 changes: 7 additions & 0 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@
</v-list>
</v-card-text>
<v-card-actions>
<v-btn
to="timeline"
v-if="isEdgeConnected"
data-cy="timeline-btn"
>
Timeline
</v-btn>
<v-spacer />
<v-btn
ref="mydevices-btn"
Expand Down

0 comments on commit cf3ab61

Please sign in to comment.