2022-03-11 21:58:23 +00:00
|
|
|
describe('User token widget on settings page,', function () {
|
|
|
|
describe('initially', function () {
|
2022-06-03 08:44:20 +00:00
|
|
|
beforeEach(() => {
|
2022-03-11 21:58:23 +00:00
|
|
|
cy.exec('npm run seed');
|
|
|
|
cy.login();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not render', function () {
|
2022-06-03 08:44:20 +00:00
|
|
|
cy.visit('/settings');
|
2022-04-13 15:26:16 +00:00
|
|
|
// make sure 'Danger Zone' is there so we know the page has rendered
|
2022-03-11 21:58:23 +00:00
|
|
|
cy.contains('Danger Zone');
|
2022-06-03 08:44:20 +00:00
|
|
|
cy.get('[data-cy=user-token]').should('not.exist');
|
2022-03-11 21:58:23 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('after creating token', function () {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.exec('npm run seed');
|
|
|
|
cy.login();
|
|
|
|
cy.visit(
|
|
|
|
'/learn/relational-database/learn-bash-by-building-a-boilerplate/build-a-boilerplate'
|
|
|
|
);
|
2022-04-13 15:26:16 +00:00
|
|
|
cy.get('[data-cy=start-codeally]').click();
|
2022-06-03 08:44:20 +00:00
|
|
|
cy.get('[data-cy=codeally-frame]').should('be.visible');
|
2022-03-11 21:58:23 +00:00
|
|
|
});
|
|
|
|
|
2022-06-03 08:44:20 +00:00
|
|
|
it('should allow you to delete your token', () => {
|
|
|
|
cy.visit('/settings');
|
2022-04-13 15:26:16 +00:00
|
|
|
// make sure 'Danger Zone' is there so we know the page has rendered
|
2022-03-11 21:58:23 +00:00
|
|
|
cy.contains('Danger Zone');
|
2022-06-03 08:44:20 +00:00
|
|
|
cy.get('[data-cy=user-token]').should('have.length', 1);
|
2022-03-11 21:58:23 +00:00
|
|
|
|
2022-04-13 15:26:16 +00:00
|
|
|
cy.get('[data-cy=delete-user-token]').click();
|
2022-03-11 21:58:23 +00:00
|
|
|
cy.contains('Your user token has been deleted.');
|
2022-06-03 08:44:20 +00:00
|
|
|
cy.get('[data-cy=user-token]').should('not.exist');
|
2022-03-11 21:58:23 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|