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

Fix test bugs #468

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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