-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1113 from nextcloud/usergroup-frontend
feat: User/group column frontend
- Loading branch information
Showing
18 changed files
with
548 additions
and
97 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,66 @@ | ||
let localUser | ||
let nonLocalUser | ||
const columnTitle = 'usergroup' | ||
const tableTitlePrefix = 'Test usergroup' | ||
let tableTitle = tableTitlePrefix | ||
let testNumber = 0 | ||
|
||
describe('Test column ' + columnTitle, () => { | ||
|
||
before(function() { | ||
cy.createRandomUser().then(user => { | ||
localUser = user | ||
}) | ||
|
||
cy.createRandomUser().then(user => { | ||
nonLocalUser = user | ||
}) | ||
}) | ||
|
||
beforeEach(function() { | ||
testNumber += 1 | ||
tableTitle = `${tableTitlePrefix} ${testNumber}` | ||
cy.login(localUser) | ||
cy.visit('apps/tables') | ||
}) | ||
|
||
it('Create column and rows with default values', () => { | ||
cy.createTable(tableTitle) | ||
cy.loadTable(tableTitle) | ||
cy.createUsergroupColumn(columnTitle, true, true, true, [localUser.userId, nonLocalUser.userId], true) | ||
cy.get('button').contains('Create row').click() | ||
cy.get('[data-cy="createRowSaveButton"]').click() | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('be.visible') | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('be.visible') | ||
}) | ||
|
||
it('Create column and rows without default values', () => { | ||
cy.createTable(tableTitle) | ||
cy.loadTable(tableTitle) | ||
cy.createUsergroupColumn(columnTitle, true, false, false, [], true) | ||
|
||
cy.get('button').contains('Create row').click() | ||
cy.get('[data-cy="usergroupRowSelect"] input').type(nonLocalUser.userId) | ||
cy.get(`.vs__dropdown-menu [id="${nonLocalUser.userId}"]`).click() | ||
cy.get('[data-cy="createRowSaveButton"]').click() | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('be.visible') | ||
}) | ||
|
||
it('Create and edit rows', () => { | ||
cy.createTable(tableTitle) | ||
cy.loadTable(tableTitle) | ||
cy.createUsergroupColumn(columnTitle, true, true, true, [localUser.userId], true) | ||
cy.get('button').contains('Create row').click() | ||
cy.get('[data-cy="createRowSaveButton"]').click() | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('be.visible') | ||
|
||
cy.get('[data-cy="ncTable"] [data-cy="editRowBtn"]').click() | ||
cy.get('[data-cy="usergroupRowSelect"] input').clear().type(nonLocalUser.userId) | ||
cy.get(`.vs__dropdown-menu [id="${nonLocalUser.userId}"]`).click() | ||
cy.get('[data-cy="editRowSaveButton"]').click() | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(localUser.userId).should('not.exist') | ||
cy.get('[data-cy="ncTable"] table tr td .userInfo').contains(nonLocalUser.userId).should('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
Oops, something went wrong.