mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Cleanup AiErrorAssistant todos post plans changes (#35067)
* feat: cleaning up ai quota leftovers fix: removing more straggler invos * fix: featureUpdater still need analyticsId in the user projection * feat: updating cypress tests to also check for fair usage text GitOrigin-RevId: 09c1167106c144084c111beea56867f6aa4a0906
This commit is contained in:
committed by
Copybot
parent
275d381656
commit
ba76fda37b
+14
-3
@@ -6,7 +6,8 @@ import {
|
||||
makeEditorProvider,
|
||||
} from '../../helpers/editor-providers'
|
||||
|
||||
const PAYWALL_TEXT = 'You’ve reached the fair usage limit on your plan'
|
||||
const PAYWALL_TEXT = 'You’ve hit your daily AI limit'
|
||||
const FAIR_USAGE_TEXT = 'You’ve reached the fair usage limit on your plan'
|
||||
|
||||
const futureDate = () => new Date(Date.now() + 60 * 60 * 1000)
|
||||
|
||||
@@ -39,14 +40,17 @@ function makeShowLogsCompileProvider(initialShowLogs: boolean) {
|
||||
return Provider
|
||||
}
|
||||
|
||||
function mountSuggestFixPaywall(initialShowLogs = true) {
|
||||
function mountSuggestFixPaywall(
|
||||
initialShowLogs = true,
|
||||
{ hasUnlimitedAi = false }: { hasUnlimitedAi?: boolean } = {}
|
||||
) {
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set('ol-showAiFeatures', true)
|
||||
win.metaAttributesCache.set('ol-hasUnlimitedAi', hasUnlimitedAi)
|
||||
})
|
||||
|
||||
cy.mount(
|
||||
<EditorProviders
|
||||
features={{ aiErrorAssistant: true }}
|
||||
providers={{
|
||||
EditorProvider: makeEditorProvider({
|
||||
hasSuggestionsLeft: false,
|
||||
@@ -72,6 +76,13 @@ describe('<ErrorAssistantAiPaywallNotification />', function () {
|
||||
cy.contains(PAYWALL_TEXT).should('be.visible')
|
||||
})
|
||||
|
||||
it('renders the fair usage limit paywall for users with unlimited AI', function () {
|
||||
mountSuggestFixPaywall(true, { hasUnlimitedAi: true })
|
||||
dispatchSuggestFixPaywall()
|
||||
cy.contains(FAIR_USAGE_TEXT).should('be.visible')
|
||||
cy.contains(PAYWALL_TEXT).should('not.exist')
|
||||
})
|
||||
|
||||
it('ignores paywall events from other origins', function () {
|
||||
mountSuggestFixPaywall()
|
||||
cy.window().then(win => {
|
||||
|
||||
Reference in New Issue
Block a user