mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-02-28 05:02:58 +05:30
Improve tests structure
This commit is contained in:
parent
5d411fd6ca
commit
ba49382fb6
@ -1,5 +1,6 @@
|
|||||||
import { account1 } from '../../fixtures/accounts.json';
|
import { account1 } from '../../fixtures/accounts.json';
|
||||||
|
|
||||||
|
describe('Forgot / reset password', () => {
|
||||||
it('should request password reset', () => {
|
it('should request password reset', () => {
|
||||||
const captchaCode = 'captchaCode';
|
const captchaCode = 'captchaCode';
|
||||||
const emailMask = 'fo*@gm*l.**m';
|
const emailMask = 'fo*@gm*l.**m';
|
||||||
@ -28,7 +29,10 @@ it('should request password reset', () => {
|
|||||||
|
|
||||||
cy.location('pathname').should('eq', '/forgot-password');
|
cy.location('pathname').should('eq', '/forgot-password');
|
||||||
|
|
||||||
cy.getByTestId('forgot-password-login').should('contain', account1.username);
|
cy.getByTestId('forgot-password-login').should(
|
||||||
|
'contain',
|
||||||
|
account1.username,
|
||||||
|
);
|
||||||
|
|
||||||
cy.window().should('have.property', 'e2eCaptchaSetCode');
|
cy.window().should('have.property', 'e2eCaptchaSetCode');
|
||||||
cy.window().then(win => {
|
cy.window().then(win => {
|
||||||
@ -214,3 +218,4 @@ it('should recover password', () => {
|
|||||||
}).toString(),
|
}).toString(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// account1 - authenticated
|
// account1 - authenticated
|
||||||
// account2 - invalid refreshToken
|
// account2 - invalid refreshToken
|
||||||
import { account1, account2 } from '../fixtures/accounts.json';
|
import { account1, account2 } from '../../fixtures/accounts.json';
|
||||||
|
|
||||||
const multiAccount = createState();
|
const multiAccount = createState();
|
||||||
const multiAccountWithBadTokens = createState();
|
const multiAccountWithBadTokens = createState();
|
@ -8,6 +8,7 @@ const defaults = {
|
|||||||
scope: 'account_info,account_email',
|
scope: 'account_info,account_email',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
describe('OAuth', () => {
|
||||||
it('should complete oauth', () => {
|
it('should complete oauth', () => {
|
||||||
cy.login({ accounts: ['default'] });
|
cy.login({ accounts: ['default'] });
|
||||||
|
|
||||||
@ -274,7 +275,10 @@ describe('prompts', () => {
|
|||||||
.contains('Approve')
|
.contains('Approve')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.url().should('match', /^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/);
|
cy.url().should(
|
||||||
|
'match',
|
||||||
|
/^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: enable, when backend api will return correct response on auth decline
|
// TODO: enable, when backend api will return correct response on auth decline
|
||||||
@ -355,7 +359,10 @@ describe('prompts', () => {
|
|||||||
.contains('Approve')
|
.contains('Approve')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.url().should('match', /^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/);
|
cy.url().should(
|
||||||
|
'match',
|
||||||
|
/^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -418,3 +425,4 @@ function assertPermissions() {
|
|||||||
'Access to your E‑mail address',
|
'Access to your E‑mail address',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
describe('Register', () => {
|
||||||
it('should register', () => {
|
it('should register', () => {
|
||||||
const username = `test${Date.now()}`;
|
const username = `test${Date.now()}`;
|
||||||
const email = `${Date.now()}@gmail.com`;
|
const email = `${Date.now()}@gmail.com`;
|
||||||
@ -143,3 +144,4 @@ it('should allow resend code', () => {
|
|||||||
|
|
||||||
cy.location('pathname').should('eq', '/activation');
|
cy.location('pathname').should('eq', '/activation');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { account1, account2 } from '../../fixtures/accounts.json';
|
import { account1, account2 } from '../../fixtures/accounts.json';
|
||||||
|
|
||||||
|
describe('Sign in / Log out', () => {
|
||||||
it('should sign in', () => {
|
it('should sign in', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
@ -250,3 +251,4 @@ describe('multi account', () => {
|
|||||||
cy.get('[data-e2e-account-id]').should('have.length', 0);
|
cy.get('[data-e2e-account-id]').should('have.length', 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { account1 } from '../../fixtures/accounts.json';
|
import { account1 } from '../../fixtures/accounts.json';
|
||||||
|
|
||||||
|
describe('feedback popup', () => {
|
||||||
it('should send feedback', () => {
|
it('should send feedback', () => {
|
||||||
const subject = 'Hello world';
|
const subject = 'Hello world';
|
||||||
const message = 'This is a feedback message';
|
const message = 'This is a feedback message';
|
||||||
@ -49,3 +50,4 @@ it('should send feedback', () => {
|
|||||||
|
|
||||||
cy.getByTestId('feedbackPopup').should('not.be.visible');
|
cy.getByTestId('feedbackPopup').should('not.be.visible');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user