Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test - add cypress data-cy labels + update jest test #301

Merged
merged 8 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/tailored/core/user/create/Create.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</div>
<div style="clear: both;"></div>

<div class="input-container">
<div class="input-container" data-cy="username-input">
<span class="label">{{$t('user.registration.username')}}</span>
<InteractablesInput :placeholder="$t('user.registration.username_placeholder')" size="small" v-model="name"
input-kind="text" type="primary" />
</div>

<div class="input-container">
<div class="input-container" data-cy="status-input">
<span class="label">{{$t('user.registration.status')}}</span>
<InteractablesInput :placeholder="$t('user.registration.status_placeholder')" size="small" v-model="status"
input-kind="text" type="primary" />
Expand All @@ -35,7 +35,7 @@
<!-- <hr class="divider"> -->
<div class="submit-container">
<InteractablesButton type="primary" size="small" :text="$t('user.registration.sign_in')"
class="create-server-btn" :action="confirm" />
class="create-server-btn" data-cy="sign-in-button" :action="confirm" />
</div>
</div>
</div>
</div>
8 changes: 4 additions & 4 deletions cypress/integration/create-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ for (const command of ['visit', 'click', 'trigger', 'type', 'clear', 'reload', '
cy.get('[data-cy=add-input]').type('22,A9ZJ[F\t5g',{log:false})
cy.contains('Store Pin? (Less Secure)')
cy.get('[data-cy=submit-input]').click()
cy.contains("We're going to create an account for you. On the next screen you'll see a set of words. Screenshot this or write it down. This is the only way to backup your account.")
cy.contains("We're going to create an account for you. On the next screen, you'll see a set of words. Screenshot this or write it down. This is the only way to backup your account.")
cy.get('.is-primary > #custom-cursor-area').click()
cy.contains('I Saved It').click()
cy.contains('Customize how the world sees you, choose something memorable.', {timeout: 5000}).should('be.visible')
cy.contains('Username')
Cypress.on('uncaught:exception', (err, runnable) => false); // temporary until AP-48 gets fixed
cy.get('.input-container:nth-child(3) .input').type(randomName) //add data-cy label - AP-53
cy.get('[data-cy=username-input]').type(randomName)
cy.contains('Status')
cy.get('.input-container:nth-child(4) .input').type(randomStatus) // add data-cy label - AP-53
cy.get('[data-cy=status-input]').type(randomStatus)
const filepath = 'images/logo.png'
cy.get('.is-outlined > #custom-cursor-area').click()
cy.get('.input-file').attachFile(filepath)
cy.contains('Crop').click()
cy.get('.create-server-btn > #custom-cursor-area').click()
cy.get('[data-cy=sign-in-button]').click()
cy.contains('Linking Satellites...')
cy.contains('Working on the space station', {timeout: 30000}).should('be.visible')
})
6 changes: 3 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Cypress.Commands.add('createAccount', () => {
cy.get('.is-primary > #custom-cursor-area').click()
cy.contains('I Saved It').click()
Cypress.on('uncaught:exception', (err, runnable) => false); // temporary until AP-48 gets fixed
cy.get('.input-container:nth-child(3) .input').type(randomName) //add data-cy label - AP-53
cy.get('.input-container:nth-child(4) .input').type(randomStatus) // add data-cy label - AP-53
cy.get('.create-server-btn > #custom-cursor-area').click();
cy.get('[data-cy=username-input]').type(randomName)
cy.get('[data-cy=status-input]').type(randomStatus)
cy.get('[data-cy=sign-in-button]').click()
})

import 'cypress-file-upload';
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@
"@nuxtjs/eslint-module": "^3.0.2",
"@types/ed2curve": "^0.2.2",
"@types/elliptic": "^6.4.13",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.10",
"@vue/test-utils": "^1.1.3",
"babel-jest": "^27.3.1",
"cypress": "^9.0.0",
"cypress": "^9.1.0",
"cypress-file-upload": "^5.0.8",
"dotenv-cli": "^4.0.0",
"electron": "^13.2.1",
Expand Down
19 changes: 10 additions & 9 deletions test/Crypto.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Crypto from '../libraries/Crypto/Crypto.ts'
import Crypto from '../libraries/Crypto/Crypto'
import 'ts-jest'

describe('Logo', () => {
describe('Crypto', () => {
// create new instance of class
const crypto = new Crypto();
const crypto = new Crypto()

// test that signMessage method exists
test("defines signMessage()", () => {
expect(typeof crypto.signMessage).toBe("function");
});
test("expect signmessage without signingKey to be null", () => {
expect(crypto.signMessage('dogs')).toBe(null);
});
})
expect(typeof crypto.signMessage).toBe("function")
})
test("expect signMessage without signingKey to be null", () => {
expect(crypto.signMessage('dogs')).toBe(null)
})
})
Loading