-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
288 changed files
with
7,792 additions
and
4,177 deletions.
There are no files selected for viewing
88 changes: 36 additions & 52 deletions
88
apps/sensenet/cypress/integration/breadcrumb/breadcrumb.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,44 @@ | ||
import { PATHS, resolvePathParams } from '../../../src/application-paths' | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
const expectedBreadcrumbItems = ['Content', '/', 'IT Workspace', '/', 'Document library'] | ||
|
||
describe('Breadcrumb', () => { | ||
before(() => { | ||
describe('breadcrumb', () => { | ||
beforeEach(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
cy.visit( | ||
pathWithQueryParams({ | ||
path: resolvePathParams({ path: PATHS.content.appPath, params: { browseType: 'explorer' } }), | ||
newParams: { repoUrl: Cypress.env('repoUrl'), path: '/IT/Document_Library' }, | ||
}), | ||
) | ||
}) | ||
it('breadcrumb after navigating to IT Workspace, breadcrumb should be displayed as it should.', () => { | ||
cy.get('[data-test="drawer-menu-item-content"]').click() | ||
cy.get('[data-test="menu-item-it-workspace"]') | ||
.click() | ||
.then(() => { | ||
cy.get('[data-test="table-cell-calendar"]').should('be.visible') | ||
}) | ||
|
||
cy.get('[data-test="menu-item-document-library"]').click({ force: true }) | ||
cy.get('nav[aria-label="breadcrumb"] li') | ||
.should('have.length', expectedBreadcrumbItems.length) | ||
.each(($el) => { | ||
expect(expectedBreadcrumbItems).to.include($el.text()) | ||
}) | ||
|
||
it('should contain the expected items', () => { | ||
const expectedItems = ['Content', 'IT Workspace', 'Document library'] | ||
|
||
cy.get('[data-test^="breadcrumb-item-"]').should('have.length', expectedItems.length) | ||
|
||
cy.get('[data-test^="breadcrumb-item-"]').each(($el, index) => { | ||
expect(expectedItems[index]).to.equal($el.text()) | ||
}) | ||
}) | ||
it('clicking on parent item in the breadcrumb should open the chosen container', () => { | ||
cy.get('[data-test="drawer-menu-item-content"]').click() | ||
cy.get('[data-test="menu-item-it-workspace"]') | ||
.click() | ||
.then(() => { | ||
cy.get('[data-test="table-cell-calendar"]').should('be.visible') | ||
}) | ||
cy.get('[data-test="menu-item-document-library"]') | ||
.click({ force: true }) | ||
.then(() => { | ||
cy.get('[data-test="table-cell-calendar"]').should('not.exist') | ||
}) | ||
cy.get('nav[aria-label="breadcrumb"] li') | ||
.find('button[aria-label="IT Workspace"]') | ||
.click() | ||
.then(() => { | ||
cy.get('[data-test="table-cell-calendar"]').should('be.visible') | ||
}) | ||
|
||
it('should navigate in the target folder on click', () => { | ||
const documentLibrarySelector = '[data-test="breadcrumb-item-document-library"]' | ||
|
||
cy.get(documentLibrarySelector).should('exist') | ||
cy.get('[data-test="breadcrumb-item-it-workspace"]').click() | ||
cy.get('[data-test="breadcrumb-item-it-workspace"]').should('exist') | ||
cy.get(documentLibrarySelector).should('not.exist') | ||
|
||
cy.location().should((loc) => { | ||
const query = new URLSearchParams(loc.search) | ||
expect(query.get('path')).to.eq('/IT') | ||
}) | ||
}) | ||
it('right click on a breadcrumb item should open its actionmenu.', () => { | ||
cy.get('[data-test="drawer-menu-item-content"]').click() | ||
cy.get('[data-test="menu-item-it-workspace"]') | ||
.click() | ||
.then(() => { | ||
cy.get('[data-test="table-cell-calendar"]').should('be.visible') | ||
}) | ||
cy.get('[data-test="menu-item-document-library"]').click({ force: true }) | ||
cy.get('nav[aria-label="breadcrumb"] li') | ||
.should('have.length', expectedBreadcrumbItems.length) | ||
.find('button[aria-label="IT Workspace"]') | ||
.rightclick() | ||
.then(() => { | ||
cy.get('ul[role="menu"]').should('be.visible') | ||
}) | ||
|
||
it('right click on a breadcrumb item should open its action menu', () => { | ||
cy.get('[data-test^="content-context-menu-"]').should('not.exist') | ||
cy.get('[data-test="breadcrumb-item-it-workspace"]').rightclick() | ||
cy.get('[data-test^="content-context-menu-"]').should('have.length.of.at.least', 1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
apps/sensenet/cypress/integration/permission-editor/local-only.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
describe('LocalOnly permission setting', () => { | ||
before(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
}) | ||
|
||
it('creates a new permsission entry', () => { | ||
cy.get('[data-test="drawer-menu-item-content"]').click() | ||
cy.get('[data-test="menu-item-it-workspace"]').rightclick() | ||
cy.get('[data-test="content-context-menu-setpermissions"]').click() | ||
cy.get('[data-test="set-on-this-visitors"]').click() | ||
cy.get('[data-test="switcher-see"]').should('be.visible') | ||
cy.get('[data-test="switcher-full-access"]').should('be.visible').click() | ||
cy.get('[data-test="switcher-full-access"]').should('be.visible').click() | ||
cy.get('[data-test="switcher-local-only"]').should('be.visible').click() | ||
cy.get('[data-test="switcher-see"]').should('be.visible').click() | ||
cy.get('[data-test="permission-editor-submit"]').click() | ||
cy.get('[data-test="set-on-this-visitors"]').should('exist') | ||
cy.get('[data-test="set-on-this-visitors-local-only"]').should('exist') | ||
}) | ||
|
||
it('reverting removes the localonly entry from the list', () => { | ||
cy.get('[data-test="set-on-this-visitors-local-only"]').click() | ||
cy.get('[data-test="switcher-see"]').should('be.visible').click() | ||
cy.get('[data-test="permission-editor-submit"]').click() | ||
cy.get('[data-test="set-on-this-visitors"]').should('exist') | ||
cy.get('[data-test="set-on-this-visitors-local-only"]').should('not.exist') | ||
}) | ||
}) |
31 changes: 31 additions & 0 deletions
31
apps/sensenet/cypress/integration/permission-editor/main_page_links.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
const makeContentText = 'Make content public' | ||
const assignNewText = 'Assign new permission' | ||
const makeContentTooltip = | ||
'Clicking this button makes the content and the below sub-tree public for non-authenticated (Visitor) users' | ||
|
||
describe('Permission editor main page links', () => { | ||
beforeEach(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
cy.get('[data-test="drawer-menu-item-content"]').click() | ||
cy.get('[data-test="menu-item-it-workspace"]').rightclick() | ||
cy.get('[data-test="content-context-menu-setpermissions"]').click() | ||
}) | ||
|
||
it('should display the appropriate buttons', () => { | ||
cy.viewport(1840, 890) | ||
cy.get('[data-test="make-content-public-or-private"]').should('be.visible').should('have.text', makeContentText) | ||
cy.get('[data-test="assign-new-permission"]').should('be.visible').should('have.text', assignNewText) | ||
cy.get('[data-test="make-content-public-or-private"]').trigger('mouseover') | ||
cy.get('[role="tooltip"]').should('have.text', makeContentTooltip) | ||
}) | ||
|
||
it('should navigate to the permission editor screen of its parent', () => { | ||
cy.get('[data-test="permission-inherited-list"]').click() | ||
cy.get('[data-test="inherited-developers-link"]').click() | ||
cy.get('[data-test="permission-view-title-first"]').should('have.text', 'Set permissions for ') | ||
cy.get('[data-test="permission-view-title-second"]').should('have.text', 'Content') | ||
}) | ||
}) |
2 changes: 1 addition & 1 deletion
2
apps/sensenet/cypress/integration/saved-queries/saved-queries.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.