DEV: introduces prettier for es6 files

This commit is contained in:
Joffrey JAFFEUX
2018-06-15 17:03:24 +02:00
committed by GitHub
parent c7ee70941e
commit 03a7d532cf
1162 changed files with 60667 additions and 29659 deletions

View File

@ -1,67 +1,73 @@
moduleFor('component:group-membership-button');
moduleFor("component:group-membership-button");
QUnit.test('canJoinGroup', function(assert) {
QUnit.test("canJoinGroup", function(assert) {
this.subject().setProperties({
model: { public_admission: false, is_group_user: true }
});
assert.equal(
this.subject().get("canJoinGroup"), false,
this.subject().get("canJoinGroup"),
false,
"can't join group if public_admission is false"
);
this.subject().set("model.public_admission", true);
assert.equal(
this.subject().get("canJoinGroup"), false,
this.subject().get("canJoinGroup"),
false,
"can't join group if user is already in the group"
);
this.subject().set("model.is_group_user", false);
assert.equal(
this.subject().get("canJoinGroup"), true,
this.subject().get("canJoinGroup"),
true,
"allowed to join group"
);
});
QUnit.test('canLeaveGroup', function(assert) {
QUnit.test("canLeaveGroup", function(assert) {
this.subject().setProperties({
model: { public_exit: false, is_group_user: false }
});
assert.equal(
this.subject().get("canLeaveGroup"), false,
this.subject().get("canLeaveGroup"),
false,
"can't leave group if public_exit is false"
);
this.subject().set("model.public_exit", true);
assert.equal(
this.subject().get("canLeaveGroup"), false,
this.subject().get("canLeaveGroup"),
false,
"can't leave group if user is not in the group"
);
this.subject().set("model.is_group_user", true);
assert.equal(
this.subject().get("canLeaveGroup"), true,
this.subject().get("canLeaveGroup"),
true,
"allowed to leave group"
);
});
QUnit.test('userIsGroupUser', function(assert) {
QUnit.test("userIsGroupUser", function(assert) {
this.subject().setProperties({
model: { is_group_user: true }
});
assert.equal(this.subject().get('userIsGroupUser'), true);
assert.equal(this.subject().get("userIsGroupUser"), true);
this.subject().set('model.is_group_user', false);
this.subject().set("model.is_group_user", false);
assert.equal(this.subject().get('userIsGroupUser'), false);
assert.equal(this.subject().get("userIsGroupUser"), false);
this.subject().set('model.is_group_user', null);
this.subject().set("model.is_group_user", null);
assert.equal(this.subject().get('userIsGroupUser'), false);
assert.equal(this.subject().get("userIsGroupUser"), false);
});