Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Fix test bugs (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvergenz authored Dec 9, 2019
1 parent 266cc3a commit 797acd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/functional-tests/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export abstract class Test {

public checkPermission(user: User) {
if (this.modsOnly) {
if (!/moderator|presenter/u.test(user.properties['altspacevr-roles'])) {
if (user.properties['altspacevr-roles']
&& !/moderator|presenter/u.test(user.properties['altspacevr-roles'])) {
throw new Error('Only moderators can run this test');
} else {
console.log(`User ${user.name} allowed to start test`);
Expand Down
10 changes: 5 additions & 5 deletions packages/functional-tests/src/tests/collision-layer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ export default class CollisionLayerTest extends Test {
}

private createWidget(root: MRE.Actor, layer1: MRE.CollisionLayer, layer2: MRE.CollisionLayer) {
const ballMesh = this.assets.meshes[0]
const ballMesh = this.assets.meshes.find(m => m.name === 'ball')
|| this.assets.createSphereMesh('ball', 0.05);
const boxMesh = this.assets.meshes[1]
const boxMesh = this.assets.meshes.find(m => m.name === 'box')
|| this.assets.createBoxMesh('box', 0.1, 0.1, 0.1);
const ballMat = this.assets.materials[0]
const ballMat = this.assets.materials.find(m => m.name === 'ball')
|| this.assets.createMaterial('ball', { color: MRE.Color3.LightGray() });
const boxDefaultMat = this.assets.materials[1]
const boxDefaultMat = this.assets.materials.find(m => m.name === 'boxDefault')
|| this.assets.createMaterial('boxDefault', { color: MRE.Color3.LightGray().toColor4(0.5) });
const boxHitMat = this.assets.materials[2]
const boxHitMat = this.assets.materials.find(m => m.name === 'boxHit')
|| this.assets.createMaterial('boxHit', { color: MRE.Color3.Red().toColor4(0.5) });

const box = MRE.Actor.Create(this.app.context, {
Expand Down

0 comments on commit 797acd2

Please sign in to comment.