Skip to content

Commit

Permalink
Adding username reminder test. (joomla#40369)
Browse files Browse the repository at this point in the history
* adding reminder test

* code style change

* code style change
  • Loading branch information
charvimehradu authored Apr 12, 2023
1 parent 3c1c108 commit 73793b3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/System/integration/site/components/com_users/Remind.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('Test the remind view', () => {
it('can open the reminder form for test user through menu item', () => {
cy.db_createUser({ name: 'test user', email: 'test@example.com' })
.then(() => cy.db_createMenuItem({ title: 'Automated test reminder', link: 'index.php?option=com_users&view=remind' }))
.then(() => {
cy.visit('/');

cy.get('a:contains(Automated test reminder)').click();
cy.get('#jform_email').type('test@example.com');
cy.get('.controls > .btn').click();

cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a reminder.');
});
});

it('can display the remind view for test user', () => {
cy.db_createUser({ name: 'test user', email: 'test@example.com' })
.then(() => {
cy.visit('index.php?option=com_users&view=remind');

cy.get('#jform_email').type('test@example.com');
cy.get('.controls > .btn').click();

cy.get('#system-message-container').should('contain.text', 'If the email address you entered is registered on this site you will shortly receive an email with a reminder.');
});
});
});

0 comments on commit 73793b3

Please sign in to comment.