Files
threshold-ui/e2e-tests/desktop/tests/settings.spec.js
T

36 lines
1.3 KiB
JavaScript
Raw Normal View History

2024-08-02 13:28:50 -04:00
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
2024-11-12 11:21:37 -05:00
import { expect, test } from '../fixtures/baseTest.js';
2024-08-02 13:28:50 -04:00
test.describe('Settings Page tests', () => {
2024-10-28 15:10:54 -04:00
test.beforeEach(async ({ authedPage }) => {
2024-08-02 13:28:50 -04:00
await authedPage.getByRole('link', { name: 'Settings' }).click();
2024-10-28 15:10:54 -04:00
});
test('Navigates to settings page', async ({ authedPage }) => {
2024-08-02 13:28:50 -04:00
await expect(authedPage).toHaveURL(
/.*\/scopes\/global\/projects\/settings$/,
);
});
2024-10-28 15:10:54 -04:00
test('Signs out from settings page', async ({ authedPage }) => {
await authedPage.getByRole('button', { name: 'Sign Out' }).click();
await expect(authedPage).toHaveURL(/.*\/scopes\/global\/authenticate\//);
});
test('Changes log level', async ({ authedPage }) => {
await authedPage.getByLabel('Logging level').selectOption('warn');
// Navigate away and back
await authedPage.getByRole('link', { name: 'Targets' }).click();
await authedPage.getByRole('link', { name: 'Settings' }).click();
await expect(authedPage.getByLabel('Logging level')).toHaveValue('warn');
await authedPage.getByLabel('Logging level').selectOption('debug');
await expect(authedPage.getByLabel('Logging level')).toHaveValue('debug');
});
// TODO: Add some client agent tests? Need to figure out best solution to include client agent
2024-08-02 13:28:50 -04:00
});