Skip to content

Commit

Permalink
docs: sprint review
Browse files Browse the repository at this point in the history
  • Loading branch information
1210954 committed Jan 3, 2024
1 parent 3a18951 commit 117598f
Show file tree
Hide file tree
Showing 10 changed files with 382 additions and 361 deletions.
4 changes: 2 additions & 2 deletions mdr/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default {
/**
* That long string from mlab
*/
databaseURL: process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017/test',
// databaseURL: process.env.MONGODB_URI || 'mongodb+srv://root:iJwu80jbwERuTa4t@maincluster.ocd2dr6.mongodb.net/?retryWrites=true&w=majority',
// databaseURL: process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017/test',
databaseURL: process.env.MONGODB_URI || 'mongodb+srv://root:iJwu80jbwERuTa4t@maincluster.ocd2dr6.mongodb.net/?retryWrites=true&w=majority',

/**
*/
Expand Down
144 changes: 111 additions & 33 deletions mdv/src/user_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ export default class UserInterface extends GUI {
constructor(private thumbRaiser: ThumbRaiser, private loader: Loader) {
super()

const audioCallback = function (enabled: boolean) {
const audioCallback = function(enabled: boolean) {
if (!enabled) {
thumbRaiser.audio.stopAll()
}
}

const textureCallback = function (options, name) {
const textureCallback = function(options, name) {
thumbRaiser.cubeTexture = new CubeTexture(
thumbRaiser.cubeTexturesParameters.skyboxes[options.indexOf(name)],
)
thumbRaiser.buildCreditsPanel()
}

const createEmoteCallback = function (animations, name) {
callbacks[name] = function () {
const createEmoteCallback = function(animations, name) {
callbacks[name] = function() {
animations.fadeToAction(name, 0.2)
}
emotesFolder.add(callbacks, name)
}

const positionCallback = function (light, distance, orientation) {
const positionCallback = function(light, distance, orientation) {
const position = light.orientationToPosition(distance, orientation)
light.position.set(position.x, position.y, position.z)
}
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class UserInterface extends GUI {
const options = {
building: [],
floor: [],
Travel: function () {
Travel: function() {
const building = optionsBuildings.getValue()
const floor = optionsFloors.getValue()
if (newMap !== '' && building && floor) {
Expand Down Expand Up @@ -109,7 +109,7 @@ export default class UserInterface extends GUI {
x1: 0, y1: 0, // Coordinates for the first floor
x2: 0, y2: 0, // Coordinates for the second floor

Simulate: function () {
Simulate: function() {
const b1 = optionsBuildings1.getValue()
const b2 = optionsBuildings2.getValue()
const f1 = optionsFloors1.getValue()
Expand Down Expand Up @@ -164,6 +164,20 @@ export default class UserInterface extends GUI {
x: 4,
y: 18
},
{
type: 'cell',
building: 'A',
floor: 1,
x: 4,
y: 19
},
{
type: 'cell',
building: 'A',
floor: 1,
x: 4,
y: 20
},
{
type: 'cell',
building: 'A',
Expand All @@ -175,65 +189,128 @@ export default class UserInterface extends GUI {
type: 'elevator',
frombuilding: 'A',
fromfloor: 1,
tobuilding: 'A',
tofloor: 2,
},
{
type: 'cell',
building: 'A',
floor: 2,
x: 1,
y: 20
},
{
type: 'cell',
building: 'A',
floor: 2,
x: 2,
y: 20
},
{
type: 'cell',
building: 'A',
floor: 2,
x: 3,
y: 20
},
{
type: 'cell',
building: 'A',
floor: 2,
x: 4,
y: 20
},
{
type: 'cell',
building: 'A',
floor: 2,
x: 4,
y: 21
},
{
type: 'elevator',
frombuilding: 'A',
fromfloor: 2,
tobuilding: 'B',
tofloor: 1,
tofloor: 2,
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 6,
y: 19
floor: 2,
x: 4,
y: 1
},
{
type: 'cell',
building: 'B',
floor: 1,
floor: 2,
x: 5,
y: 18
y: 1
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 5,
y: 17
floor: 2,
x: 6,
y: 1
},
{
type: 'cell',
building: 'B',
floor: 2,
x: 7,
y: 1
},
{
type: 'cell',
building: 'B',
floor: 2,
x: 8,
y: 1
},
{
type: 'cell',
building: 'B',
floor: 2,
x: 8,
y: 2
},

{
type: 'cell',
building: 'B',
floor: 1,
x: 5,
y: 16
floor: 2,
x: 8,
y: 3
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 4,
y: 16
floor: 2,
x: 8,
y: 4
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 4,
y: 15
floor: 2,
x: 8,
y: 6
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 4,
y: 14
floor: 2,
x: 7,
y: 6
},
{
type: 'cell',
building: 'B',
floor: 1,
x: 4,
y: 13
floor: 2,
x: 6,
y: 6
},
{
type: 'cell',
Expand All @@ -250,6 +327,7 @@ export default class UserInterface extends GUI {
y: 11
},
];

if (b1 && b2 && f1 && f2) {
thumbRaiser.simulate(examplePath)
}
Expand All @@ -269,8 +347,8 @@ export default class UserInterface extends GUI {
options2.x1 = 0
options2.y1 = 0
});
autFolder.add(options2, 'x1', 0, 30,1)
autFolder.add(options2, 'y1', 0, 30,1)
autFolder.add(options2, 'x1', 0, 30, 1)
autFolder.add(options2, 'y1', 0, 30, 1)
const optionsBuildings2 = autFolder.add(options2, 'building1', buildings)
const optionsFloors2 = autFolder.add(options2, 'floor1', floors2)
optionsBuildings2.onChange((val: string) => {
Expand Down
110 changes: 55 additions & 55 deletions spa/cypress/e2e/delete-client.cy.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
function loginViaAuth0Ui(username: string, password: string) {
cy.origin(
Cypress.env('auth_domain'),
{ args: { username, password } },
({ username, password }) => {
cy.get('input#1-email').type(username)
cy.get('input#1-password').type(password, { log: false })
cy.get('button[type="submit"]')
.should('be.visible')
.should('contain.text', 'Log In')
.should('not.be.disabled')
.should('not.be.hidden')
.click()
},
)
}
// function loginViaAuth0Ui(username: string, password: string) {
// cy.origin(
// Cypress.env('auth_domain'),
// { args: { username, password } },
// ({ username, password }) => {
// cy.get('input#1-email').type(username)
// cy.get('input#1-password').type(password, { log: false })
// cy.get('button[type="submit"]')
// .should('be.visible')
// .should('contain.text', 'Log In')
// .should('not.be.disabled')
// .should('not.be.hidden')
// .click()
// },
// )
// }

describe('Delete client Form e2e tests', () => {
beforeEach(() => {
window.localStorage.setItem('USER_ROLES', 'CLT')
cy.visit('/delete-client')
// describe('Delete client Form e2e tests', () => {
// beforeEach(() => {
// window.localStorage.setItem('USER_ROLES', 'CLT')
// cy.visit('/delete-client')

const log = Cypress.log({
displayName: 'AUTH0 LOGIN',
message: [`🔐 Authenticating | ${Cypress.env('auth_username')}`],
// @ts-ignore
autoEnd: false,
})
log.snapshot('before')
// const log = Cypress.log({
// displayName: 'AUTH0 LOGIN',
// message: [`🔐 Authenticating | ${Cypress.env('auth_username')}`],
// // @ts-ignore
// autoEnd: false,
// })
// log.snapshot('before')

loginViaAuth0Ui(Cypress.env('auth_username'), Cypress.env('auth_password'))
// loginViaAuth0Ui(Cypress.env('auth_username'), Cypress.env('auth_password'))

log.snapshot('after')
log.end()
})
// log.snapshot('after')
// log.end()
// })

it('has the correct title', () => {
cy.title().should('equal', 'Delete Client')
})
// it('has the correct title', () => {
// cy.title().should('equal', 'Delete Client')
// })

it('should delete the client account', () => {
cy.intercept('POST', 'http://localhost:4000/api/clients', {
statusCode: 201,
body: {
name: 'quim',
email: 'e2e-testing@isep.ipp.pt',
phoneNumber: '123719765',
vatNumber: '123189763',
password: 'Passw0rd!T',
},
}).as('createClient')
// it('should delete the client account', () => {
// cy.intercept('POST', 'http://localhost:4000/api/clients', {
// statusCode: 201,
// body: {
// name: 'quim',
// email: 'e2e-testing@isep.ipp.pt',
// phoneNumber: '123719765',
// vatNumber: '123189763',
// password: 'Passw0rd!T',
// },
// }).as('createClient')

const email = 'e2e-testing@isep.ipp.pt'
// const email = 'e2e-testing@isep.ipp.pt'

cy.intercept('DELETE', 'http://localhost:4000/clients/e2e-testing@isep.ipp.pt', {
statusCode: 201,
body: {
email: email,
},
}).as('deleteClient')
// cy.intercept('DELETE', 'http://localhost:4000/clients/e2e-testing@isep.ipp.pt', {
// statusCode: 201,
// body: {
// email: email,
// },
// }).as('deleteClient')

cy.get('button[type="submit"]').click()
})
})
// cy.get('button[type="submit"]').click()
// })
// })
Loading

0 comments on commit 117598f

Please sign in to comment.