Allow group plans for private guilds only (#12479)

* hide upgrade button for public guilds

* prevent group plans for public guilds

* fix unit tests

* fix integration and unit tests that assumed group plans could be public guilds

* more unit tests fixes

* more resilient unit test

* more resilient unit test
This commit is contained in:
Matteo Pagliazzi
2020-08-21 11:46:09 +02:00
committed by GitHub
parent 633f3df372
commit 46b5efcaf6
9 changed files with 145 additions and 85 deletions

View File

@@ -274,6 +274,7 @@ describe('POST /groups/:groupId/leave', () => {
each(typesOfGroups, (groupDetails, groupType) => {
context(`Leaving a group plan when the group is a ${groupType}`, () => {
if (groupDetails.privacy === 'public') return; // public guilds cannot be group plans
let groupWithPlan;
let leader;
let member;
@@ -341,6 +342,7 @@ describe('POST /groups/:groupId/leave', () => {
each(typesOfGroups, (groupDetails, groupType) => {
context(`Leaving a group with extraMonths left plan when the group is a ${groupType}`, () => {
if (groupDetails.privacy === 'public') return; // public guilds cannot be group plans
const extraMonths = 12;
let groupWithPlan;
let member;