Skip to content

Commit

Permalink
add one more AI test
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed May 13, 2024
1 parent cdbbe1c commit c5ed946
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/tests/subscriptionManagement/subscription-storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,37 @@ describe('Ribbon logic', () => {

expect(result).toBe(true)
})
it('should allow action if user has AIpowerupOwnKey powerup AND no key AND not hit free quota', async ({
device,
}) => {
const { browserAPIs, analytics, collectionsBG } = await setupTest(
device,
)

const fakeStorageEntry = {
...DEFAULT_COUNTER_STORAGE_VALUE,
cQ: DEFAULT_POWERUP_LIMITS.AIpowerup - 10,
pU: {
...DEFAULT_COUNTER_STORAGE_VALUE.pU,
AIpowerupOwnKey: true,
},
}

await browserAPIs.storage.local.set({
[COUNTER_STORAGE_KEY]: fakeStorageEntry,
})

const result = await AIActionAllowed(
browserAPIs,
analytics,
false,
false,
'gpt-3',
)

expect(result).toBe(true)
})

it('should prevent action if user has AIpowerupOwnKey powerup AND no key AND over free tier limit', async ({
device,
}) => {
Expand Down Expand Up @@ -329,10 +360,6 @@ describe('Ribbon logic', () => {
)
expect(result).toBe(false)
})

// it('should allow action if user is out of trial time and below the sessionlimit', async ({

// it('should allow action if user has AIpowerupOwnKey powerup AND no key AND over free tier limit', async ({
})

describe('Check for the stripe plan and give back my current subscription status.', () => {
Expand Down

0 comments on commit c5ed946

Please sign in to comment.