Skip to content

Commit

Permalink
Merge branch 'main' into update-attachmentList-config-v4
Browse files Browse the repository at this point in the history
  • Loading branch information
lassopicasso committed Feb 6, 2024
2 parents f017dd5 + 598b8f6 commit a3a9228
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AltinnAppGitRepository : AltinnGitRepository
private const string LANGUAGE_RESOURCE_FOLDER_NAME = "texts/";
private const string MARKDOWN_TEXTS_FOLDER_NAME = "md/";
private const string PROCESS_DEFINITION_FOLDER_PATH = "App/config/process/";
private const string CSHTML_PATH = "App/views/Home/index.cshtml";
private const string CSHTML_PATH = "App/views/Home/Index.cshtml";

private const string SERVICE_CONFIG_FILENAME = "config.json";
private const string LAYOUT_SETTINGS_FILENAME = "Settings.json";
Expand Down
1 change: 0 additions & 1 deletion frontend/testing/playwright/pages/DashboardPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export class DashboardPage extends BasePage {
await this.page
.getByRole('menuitem', {
name: this.textMock('dashboard.edit_app', { appName }),
exact: true,
})
.click();
}
Expand Down
11 changes: 8 additions & 3 deletions frontend/testing/playwright/tests/dashboard/dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ import { DashboardPage } from 'testing/playwright/pages/DashboardPage';
import { OverviewPage } from 'testing/playwright/pages/OverviewPage';
import { Gitea } from '../../helpers/Gitea';

const getExtraAppName = (appName: string): string => `extra-app-${appName}`;

// Before the tests starts, we need to create the dashboard app
test.beforeAll(async ({ testAppName, request, storageState }) => {
// Create 2 apps
const testAppName2: string = `${testAppName}2`;
const firstApp = await createApp(testAppName, request, storageState as StorageState);
const secondApp = await createApp(testAppName2, request, storageState as StorageState);
const secondApp = await createApp(
getExtraAppName(testAppName),
request,
storageState as StorageState,
);

expect(firstApp.ok()).toBeTruthy();
expect(secondApp.ok()).toBeTruthy();
});

test.afterAll(async ({ request, testAppName }) => {
const gitea = new Gitea();
const appsToDelete: string[] = [testAppName, `${testAppName}2`];
const appsToDelete: string[] = [testAppName, getExtraAppName(testAppName)];

for (const app of appsToDelete) {
const response = await request.delete(gitea.getDeleteAppEndpoint({ app }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ test('That it is possible to navigate from overview to the deploy page and back
request,
storageState,
}) => {
const testDepartmentOrg: string = 'ttd';

const designerApi = new DesignerApi({ app: testAppName });
const response = await designerApi.createApp(request, storageState as StorageState, 'ttd');
const response = await designerApi.createApp(
request,
storageState as StorageState,
testDepartmentOrg,
);
expect(response.ok()).toBeTruthy();

const dashboardPage = new DashboardPage(page, { app: testAppName });
Expand All @@ -149,13 +155,12 @@ test('That it is possible to navigate from overview to the deploy page and back
await dashboardPage.loadDashboardPage();
await dashboardPage.verifyDashboardPage();

const testDepartmentOrg: string = 'ttd';

// Change org to TTD
await dashboardPage.clickOnHeaderAvatar();
await dashboardPage.clickOnOrgApplications();
dashboardPage.updateOrgNameEnv(testDepartmentOrg);
await dashboardPage.checkThatTTDApplicationsHeaderIsVisible();

expect(dashboardPage.org).toEqual('ttd');
await dashboardPage.clickOnTestAppEditButton(testAppName);

// As we have changed env.org to 'ttd', we need to update the org of the new classes to make sure it works.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,27 @@ test('That it is possible to edit security level on "Policy editor" tab, and tha

const securityLevel2 = 2;
const securityLevel2Text = policyEditor.getSecurityLevelByTextByLevel(securityLevel2);
expect(await policyEditor.getSelectedSecurityLevel()).toEqual(securityLevel2Text);

const securityValueInitial = await policyEditor.getSelectedSecurityLevel();
expect(securityValueInitial).toBe(securityLevel2Text);

await policyEditor.clickOnSecurityLevelSelect();
await policyEditor.clickOnSecurityLevelSelectOption(3);

const securityLevel3 = 3;
const securityLevel3Text = policyEditor.getSecurityLevelByTextByLevel(securityLevel3);
expect(await policyEditor.getSelectedSecurityLevel()).toEqual(securityLevel3Text);

const securityValueAfterChange = await policyEditor.getSelectedSecurityLevel();
expect(securityValueAfterChange).toBe(securityLevel3Text);

await settingsModal.navigateToTab('about');
await settingsModal.verifyThatTabIsVisible('about');
await settingsModal.verifyThatTabIsHidden('policy');

await settingsModal.navigateToTab('policy');
expect(await policyEditor.getSelectedSecurityLevel()).toEqual(securityLevel3Text);

const securityValueAfterNavigation = await policyEditor.getSelectedSecurityLevel();
expect(securityValueAfterNavigation).toBe(securityLevel3Text);
});

test('That it is possible to change tab to "Access control" tab', async ({ page, testAppName }) => {
Expand Down

0 comments on commit a3a9228

Please sign in to comment.