Skip to content

Commit

Permalink
feat: Add hasSeatsLeft to plan query (#2827)
Browse files Browse the repository at this point in the history
* feat: Add hasSeatsLeft to plan query

* update to use hasSeatsLeft
  • Loading branch information
RulaKhaled authored May 2, 2024
1 parent 784493b commit cbfc013
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/DefaultOrgSelector/DefaultOrgSelector.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const mockTrialData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

let testLocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanDataResponseNoUploadLimit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const mockResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPreTrialPlanInfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const mockPlanBasic = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanPro = {
Expand All @@ -39,6 +40,7 @@ const mockPlanPro = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 4,
hasSeatsLeft: true,
}

const mockPlanTrialing = {
Expand All @@ -54,6 +56,7 @@ const mockPlanTrialing = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 4,
hasSeatsLeft: true,
}

const mockAvailablePlans = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const mockResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const mockProPlan = {
trialEndDate: '',
trialTotalDays: 0,
pretrialUsersCount: 0,
hasSeatsLeft: true,
}

const mockTeamPlan = {
Expand All @@ -48,6 +49,7 @@ const mockTeamPlan = {
trialEndDate: '',
trialTotalDays: 0,
pretrialUsersCount: 0,
hasSeatsLeft: true,
}

const mockScheduleDetail = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const mockTrialData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const mockPlanDataResponseMonthly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanDataResponseYearly = {
Expand All @@ -133,6 +134,7 @@ const mockPlanDataResponseYearly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const mockPlanDataResponseMonthly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanDataResponseYearly = {
Expand All @@ -121,6 +122,7 @@ const mockPlanDataResponseYearly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const mockPlanDataResponse = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const server = setupServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const mockPlanDataResponseYearly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const mockPlanDataResponseMonthly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanDataResponseYearly = {
Expand All @@ -121,6 +122,7 @@ const mockPlanDataResponseYearly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const mockPlanDataResponseMonthly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const mockPlanDataResponseYearly = {
Expand All @@ -215,6 +216,7 @@ const mockPlanDataResponseYearly = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const mockPlanData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

const queryClient = new QueryClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const mockTrialData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
}

describe('ActivationBanner', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/services/account/usePlanData.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const mockTrialData = {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
},
pretrialPlan: {
baseUnitPrice: 10,
Expand Down Expand Up @@ -92,6 +93,7 @@ describe('usePlanData', () => {
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
hasSeatsLeft: true,
},
pretrialPlan: {
baseUnitPrice: 10,
Expand Down
2 changes: 2 additions & 0 deletions src/services/account/usePlanData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const PlanSchema = z.object({
trialStartDate: z.string().nullable(),
trialTotalDays: z.number().nullable(),
planUserCount: z.number().nullable(),
hasSeatsLeft: z.boolean(),
})

export type Plan = z.infer<typeof PlanSchema>
Expand Down Expand Up @@ -75,6 +76,7 @@ export const query = `
trialStartDate
trialTotalDays
planUserCount
hasSeatsLeft
}
pretrialPlan {
baseUnitPrice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ describe('TrialBanner', () => {
trialTotalDays: plan.trialTotalDays,
pretrialUsersCount: plan.pretrialUsersCount,
planUserCount: plan.planUserCount,
hasSeatsLeft: true,
},
},
})
Expand Down

0 comments on commit cbfc013

Please sign in to comment.