mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Free AI credits experiment evaluation (no-changelog) (#12481)
This commit is contained in:
parent
3d990eb555
commit
adcedd1c2b
|
@ -86,7 +86,7 @@ describe('FreeAiCreditsCallout', () => {
|
|||
});
|
||||
|
||||
(usePostHog as any).mockReturnValue({
|
||||
isFeatureEnabled: vi.fn().mockReturnValue(true),
|
||||
getVariant: vi.fn().mockReturnValue('variant'),
|
||||
});
|
||||
|
||||
(useProjectsStore as any).mockReturnValue({
|
||||
|
@ -150,7 +150,7 @@ describe('FreeAiCreditsCallout', () => {
|
|||
|
||||
it('should not be able to claim credits if user it is not in experiment', async () => {
|
||||
(usePostHog as any).mockReturnValue({
|
||||
isFeatureEnabled: vi.fn().mockReturnValue(false),
|
||||
getVariant: vi.fn().mockReturnValue('control'),
|
||||
});
|
||||
|
||||
renderComponent(FreeAiCreditsCallout);
|
||||
|
|
|
@ -27,7 +27,7 @@ const showSuccessCallout = ref(false);
|
|||
const claimingCredits = ref(false);
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const postHogStore = usePostHog();
|
||||
const posthogStore = usePostHog();
|
||||
const credentialsStore = useCredentialsStore();
|
||||
const usersStore = useUsersStore();
|
||||
const ndvStore = useNDVStore();
|
||||
|
@ -57,7 +57,7 @@ const userCanClaimOpenAiCredits = computed(() => {
|
|||
return (
|
||||
settingsStore.isAiCreditsEnabled &&
|
||||
activeNodeHasOpenAiApiCredential.value &&
|
||||
postHogStore.isFeatureEnabled(AI_CREDITS_EXPERIMENT.name) &&
|
||||
posthogStore.getVariant(AI_CREDITS_EXPERIMENT.name) === AI_CREDITS_EXPERIMENT.variant &&
|
||||
!userHasOpenAiCredentialAlready.value &&
|
||||
!userHasClaimedAiCreditsAlready.value
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue