2020-07-16 13:50:16 +00:00
|
|
|
/// <reference types="Cypress" />
|
|
|
|
/* globals cy, expect */
|
|
|
|
|
|
|
|
context('Leave Channel Browser Testing', () => {
|
|
|
|
let tableQuery = [
|
|
|
|
'solid-display.table-body',
|
|
|
|
'solid-display:last-child',
|
2021-06-15 11:48:49 +00:00
|
|
|
'orbit-admin-circle-leave-button',
|
2020-07-16 13:50:16 +00:00
|
|
|
'solid-delete'
|
|
|
|
],
|
|
|
|
tableListQuery = [
|
|
|
|
'solid-display[nested-field="circles"]',
|
|
|
|
'div >',
|
|
|
|
'solid-display'
|
|
|
|
];
|
|
|
|
before(() => {
|
|
|
|
cy.clearLocalStorageSnapshot();
|
|
|
|
cy.clearLocalStorage({ domain: null });
|
|
|
|
cy.clearCookies({ domain: null });
|
|
|
|
});
|
|
|
|
beforeEach(() => cy.restoreLocalStorage());
|
|
|
|
afterEach(() => cy.saveLocalStorage());
|
|
|
|
it('should visit user login screend', () => cy.userLogin());
|
|
|
|
it('should login', () => cy.login());
|
|
|
|
describe('Channel Leaving process', () => {
|
2020-09-17 11:08:44 +00:00
|
|
|
it('should visit the channels list screen', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.visit('/admin-circles');
|
2020-09-17 11:08:44 +00:00
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles');
|
2020-09-17 11:08:44 +00:00
|
|
|
});
|
|
|
|
});
|
2020-07-16 13:50:16 +00:00
|
|
|
it('should click the last channel leave button', () => {
|
|
|
|
cy.get(tableListQuery.join(' ')).its('length').as('channelsLength');
|
|
|
|
cy.get(tableQuery.join(' ')).click();
|
|
|
|
});
|
2021-02-22 20:27:58 +00:00
|
|
|
it('should check if channel was left', () => {
|
2020-07-16 13:50:16 +00:00
|
|
|
cy.get(tableListQuery.join(' ')).its('length').should(length => {
|
|
|
|
expect(length).to.eq(this.channelsLength - 1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|