-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the following functions to the js api: * `updateCollectiveEditPermissions` * `updateCollectiveSharePermissions` * `updateCollectiveEditMode` These wrap the corresponding API endpoints. Use them from the store and the cypress tests. Also extract `collective-edit-mode.spec.js` from `pages.spec.js`. It requires a different beforeEach function to seed the edit mode before visiting the collective. Signed-off-by: Max <[email protected]>
- Loading branch information
1 parent
c475252
commit 9aca9df
Showing
6 changed files
with
84 additions
and
39 deletions.
There are no files selected for viewing
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,62 @@ | ||
/** | ||
* @copyright Copyright (c) 2021 Azul <[email protected]> | ||
* | ||
* @author Azul <[email protected]> | ||
* | ||
* @license AGPL-3.0-or-later | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
describe('Collective page mode', function() { | ||
|
||
before(function() { | ||
cy.loginAs('bob') | ||
cy.deleteAndSeedCollective('Our Garden') | ||
.seedPage('Day 1', '', 'Readme.md') | ||
.seedPage('Day 2', '', 'Readme.md') | ||
}) | ||
|
||
beforeEach(function() { | ||
cy.loginAs('bob') | ||
}) | ||
|
||
describe('Changing page mode', function() { | ||
it('Opens edit mode per default', function() { | ||
cy.seedCollectivePageMode('Our Garden', 1) | ||
cy.visit('/apps/collectives/Our Garden') | ||
// make sure the page list loaded properly | ||
cy.contains('.app-content-list-item a', 'Day 1') | ||
cy.openPage('Day 2') | ||
cy.getEditor() | ||
.should('be.visible') | ||
cy.getReadOnlyEditor() | ||
.should('not.be.visible') | ||
}) | ||
|
||
it('Opens view mode per default', function() { | ||
cy.seedCollectivePageMode('Our Garden', 0) | ||
cy.visit('/apps/collectives/Our Garden') | ||
// make sure the page list loaded properly | ||
cy.contains('.app-content-list-item a', 'Day 1') | ||
cy.openPage('Day 2') | ||
cy.getReadOnlyEditor() | ||
.should('be.visible') | ||
cy.getEditor() | ||
.should('not.be.visible') | ||
}) | ||
}) | ||
}) | ||
|
||
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
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