Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.40",
"@umbraco/playwright-testhelpers": "^16.0.50",
"@umbraco/playwright-testhelpers": "^16.0.55",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "../../umbraco-package-schema.json",
"name": "My workspace",
"version": "0.1.0",
"extensions": [
{
"type": "workspaceView",
"alias": "My.WorkspaceView",
"name": "My Workspace View",
"element": "/App_Plugins/workspace-view/workspace-view.js",
"meta": {
"label": "My Workspace View",
"pathname": "/my-workspace-view",
"icon": "icon-add"
},
"conditions": [
{
"alias": "Umb.Condition.WorkspaceAlias",
"match": "Umb.Workspace.Document"
}
]
}
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

// Content
const contentName = 'TestContent';
// DocumentType
const documentTypeName = 'TestDocumentTypeForContent';
// DataType
const dataTypeName = 'Textstring';
// Media
const mediaName = 'TestMedia';

test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(contentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.media.ensureNameNotExists(mediaName);
});

test('can see the custom workspace view in the content section', async ({umbracoApi, umbracoUi}) => {
// Arrange
const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeData.id);
await umbracoApi.document.createDocumentWithTextContent(contentName, documentTypeId, 'Test content', dataTypeName);

// Act
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
await umbracoUi.content.goToContentWithName(contentName);

// Assert
await umbracoUi.content.isWorkspaceViewTabWithAliasVisible('My.WorkspaceView', true);
});

test('cannot see the custom workspace view in the media section', async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.media.createDefaultMediaWithImage(mediaName);

// Act
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.media);
await umbracoUi.media.goToMediaWithName(mediaName);

// Assert
await umbracoUi.media.isWorkspaceViewTabWithAliasVisible('My.WorkspaceView', false);
});