Skip to content

Commit

Permalink
[5.2][cypress] clean user session (#45059)
Browse files Browse the repository at this point in the history
heelc29 authored Mar 2, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2e81829 commit 0c154ff
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ describe('Test in frontend that the users registration view', () => {
});
afterEach(() => {
cy.db_updateExtensionParameter('allowUserRegistration', '0', 'com_users');
cy.task('queryDB', "DELETE FROM #__user_usergroup_map WHERE user_id = (SELECT id FROM #__users WHERE username = 'testuser')");
cy.task('queryDB', "DELETE FROM #__users WHERE username = 'testuser'");
});

1 change: 1 addition & 0 deletions tests/System/plugins/db.mjs
Original file line number Diff line number Diff line change
@@ -165,6 +165,7 @@ function deleteInsertedItems(config) {
if (item.table === `${config.env.db_prefix}users`) {
promises.push(queryTestDB(`DELETE FROM #__user_usergroup_map WHERE user_id IN (${item.rows.join(',')})`, config));
promises.push(queryTestDB(`DELETE FROM #__user_profiles WHERE user_id IN (${item.rows.join(',')})`, config));
promises.push(queryTestDB(`DELETE FROM #__session WHERE userid IN (${item.rows.join(',')})`, config));
}

if (item.table === `${config.env.db_prefix}content`) {

0 comments on commit 0c154ff

Please sign in to comment.