Skip to content

Commit

Permalink
project space creation
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya committed Dec 6, 2023
1 parent c64b2e8 commit e3bbdb5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Feature: spaces management
| Alice | Space Admin |
| Brian | Space Admin |
When "Alice" logs in
# And "Alice" creates the following folders in personal space using API
# | name |
# | folderPublic |
And "Alice" creates the following project spaces using API
| name | id |
| team A | team.a |
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/cucumber/steps/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Given(
const admin = this.usersEnvironment.getUser({ key: stepUser })
for await (const info of stepTable.hashes()) {
const user = this.usersEnvironment.getUser({ key: info.id })
const id = await api.graph.getUserId({ user, admin })
console.log('ocis id', id)
// const id = await api.graph.getUserId({ user, admin })
// await api.graph.assignRole(admin, id, info.role)
await api.provision.assignRole({ admin, user, role: info.role })
}
Expand Down Expand Up @@ -147,7 +146,6 @@ Given(
Given(
'{string} creates the following project space(s) using API',
async function (this: World, stepUser: string, stepTable: DataTable): Promise<void> {
// while (true) {}
const user = this.usersEnvironment.getUser({ key: stepUser })
for (const space of stepTable.hashes()) {
const spaceId = await api.graph.createSpace({ user, space: space as unknown as Space })
Expand Down
18 changes: 1 addition & 17 deletions tests/e2e/support/api/graph/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,8 @@ export const createSpace = async ({
body,
user: user
})
// let response
// if(config.keycloak) {
// response = await request({
// method: 'POST',
// path: join('graph', 'v1.0', 'drives'),
// body,
// user: user,
// isKeycloakRequest: true
// })
// } else {
// response = await request({
// method: 'POST',
// path: join('graph', 'v1.0', 'drives'),
// body,
// user: user
// })
// }
console.log(response)
// while (true){}

// To make api request work consistently with UI we need to create a hidden folder '.space'
// Inside .space it consist of files that may be required to update the space (e.g. change description of space (stored by readme.md), change image of space)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/support/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const request = async ({
...(user.id && authHeader),
...header
}

console.log(basicHeader)
const baseUrl = isKeycloakRequest ? config.keycloakUrl : config.backendUrl
return await fetch(join(baseUrl, path), {
method,
Expand Down
4 changes: 0 additions & 4 deletions tests/e2e/support/api/keycloak/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ export const createUser = async ({ user, admin }: { user: User; admin: User }):
}

export const assignRole = async ({ admin, user, role }) => {
console.log(user)
const usersEnvironment = new UsersEnvironment()
const createdUser = usersEnvironment.getCreatedUser({ key: user.id })
console.log('keycloak', createdUser.uuid)
const response = await request({
method: 'POST',
path: join(realmBasePath, 'users', createdUser.uuid, 'role-mappings', 'realm'),
Expand All @@ -75,8 +73,6 @@ export const assignRole = async ({ admin, user, role }) => {
user: admin,
header: { 'Content-Type': 'application/json' }
})
console.log(response.url)
console.log(response)
return response
}

Expand Down

0 comments on commit e3bbdb5

Please sign in to comment.