diff --git a/test/client/unit/specs/mixins/groupsUtilities.spec.js b/test/client/unit/specs/mixins/groupsUtilities.spec.js new file mode 100644 index 0000000000..ada7f52657 --- /dev/null +++ b/test/client/unit/specs/mixins/groupsUtilities.spec.js @@ -0,0 +1,61 @@ +import groupsUtilities from 'client/mixins/groupsUtilities'; +import { TAVERN_ID } from 'common/script/constants'; +import Vue from 'vue'; + +describe('Groups Utilities Mixin', () => { + let instance, user; + + before(() => { + instance = new Vue({ + mixins: [groupsUtilities], + }); + + user = { + _id: '123', + party: { + _id: '456', + }, + guilds: ['789'], + }; + }); + + describe('isMemberOfGroup', () => { + it('registers as a method', () => { + expect(instance.isMemberOfGroup).to.be.a.function; + }); + + it('returns true when the group is the Tavern', () => { + expect(instance.isMemberOfGroup(user, { + _id: TAVERN_ID, + })).to.equal(true); + }); + + it('returns true when the group is the user\'s party', () => { + expect(instance.isMemberOfGroup(user, { + type: 'party', + _id: user.party._id, + })).to.equal(true); + }); + + it('returns false when the group is not the user\'s party', () => { + expect(instance.isMemberOfGroup(user, { + type: 'party', + _id: 'not my party', + })).to.equal(false); + }); + + it('returns true when the group is not a guild of which the user is a member', () => { + expect(instance.isMemberOfGroup(user, { + type: 'guild', + _id: user.guilds[0], + })).to.equal(true); + }); + + it('returns false when the group is not a guild of which the user is a member', () => { + expect(instance.isMemberOfGroup(user, { + type: 'guild', + _id: 'not my guild', + })).to.equal(false); + }); + }); +}); \ No newline at end of file diff --git a/website/client/assets/less/forms.less b/website/client/assets/less/forms.less new file mode 100644 index 0000000000..bd256066ea --- /dev/null +++ b/website/client/assets/less/forms.less @@ -0,0 +1,7 @@ +.label-primary { + font-weight: bold; +} + +.nested-field { + padding-left: 1.5rem; +} \ No newline at end of file diff --git a/website/client/assets/less/index.less b/website/client/assets/less/index.less index 1397606124..da8c3da799 100644 --- a/website/client/assets/less/index.less +++ b/website/client/assets/less/index.less @@ -1,5 +1,6 @@ // CSS that doesn't belong to any specific Vue compoennt @import './utilities'; +@import './forms'; @import './loading-screen'; body { diff --git a/website/client/assets/less/semantic-ui/semantic.less b/website/client/assets/less/semantic-ui/semantic.less index d078ed3a2b..be2f24744d 100644 --- a/website/client/assets/less/semantic-ui/semantic.less +++ b/website/client/assets/less/semantic-ui/semantic.less @@ -30,7 +30,7 @@ // & { @import "~semantic-ui-less/definitions/elements/loader"; } // & { @import "~semantic-ui-less/definitions/elements/rail"; } // & { @import "~semantic-ui-less/definitions/elements/reveal"; } -// & { @import "~semantic-ui-less/definitions/elements/segment"; } +& { @import "~semantic-ui-less/definitions/elements/segment"; } // & { @import "~semantic-ui-less/definitions/elements/step"; } /* Collections */ diff --git a/website/client/components/inventory/stable.vue b/website/client/components/inventory/stable.vue index defda26840..3e50b471e9 100644 --- a/website/client/components/inventory/stable.vue +++ b/website/client/components/inventory/stable.vue @@ -9,35 +9,35 @@ .ui.form .field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label.label-primary(v-once) {{ $t('pets') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('hatchingPotions') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('quest') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('special') }} .field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label.label-primary(v-once) {{ $t('mounts') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('hatchingPotions') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('quest') }} .field.nested-field .ui.checkbox - input(type='checkbox') + input(type="checkbox") label(v-once) {{ $t('special') }} .thirteen.wide.column @@ -60,18 +60,9 @@ h2 Mounts h2 Quest Mounts h2 Rare Mounts -