Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #359 from SE-TINF22B6/frontend-fix-test
Browse files Browse the repository at this point in the history
Frontend: fix test interfering with other test
  • Loading branch information
MaarcS authored Jun 10, 2024
2 parents cbad496 + 1495e93 commit 11aa15a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Frontend/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.setTimeout(20_000);

beforeAll(async () => {
const options = new Chrome.Options();
options.addArguments( 'headless', 'ignore-certificate-errors', '--disable-single-click-autofill');
options.addArguments('headless', 'ignore-certificate-errors', '--disable-single-click-autofill');
options.setUserPreferences({ 'autofill.profile_enabled': false });
driver = await new Builder().forBrowser(Browser.CHROME).setChromeOptions(options).build();
await driver.manage().setTimeouts({ implicit: 2000 });
Expand Down
2 changes: 2 additions & 0 deletions Frontend/src/tests/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ describe('test with logged in user', () => {

test('user cannot delete account when entering wrong password', async () => {
// ARRANGE
await driver.navigate().refresh();
await driver.wait(until.elementLocated(By.id('deleteAccountButton')));
const deleteAccountButton = await driver.findElement(By.id('deleteAccountButton'));
await driver.wait(until.elementIsVisible(deleteAccountButton));
Expand All @@ -229,6 +230,7 @@ describe('test with logged in user', () => {

// ASSERT
const passwordDeleteMessage = await driver.findElement(By.id('passwordDeleteMessage'));
await driver.wait(until.elementTextMatches(passwordDeleteMessage, /.+/));
expect(await passwordDeleteMessage.getText()).toEqual('Invalid password.');
});

Expand Down

0 comments on commit 11aa15a

Please sign in to comment.