diff --git a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx index 2fbe0a0be1703..2a6055ce46aa3 100644 --- a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx +++ b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.test.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router'; import { render, screen } from 'design/utils/testing'; -import { createTeleportContext } from 'teleport/mocks/contexts'; +import { createTeleportContext, getAcl } from 'teleport/mocks/contexts'; import { ContextProvider } from 'teleport/index'; import cfg from 'teleport/config'; @@ -28,8 +28,6 @@ import { clusters } from 'teleport/Clusters/fixtures'; import { storageService } from 'teleport/services/storageService'; -import { getAcl } from 'teleport/mocks/contexts'; - import { ExternalAuditStorageCta } from './ExternalAuditStorageCta'; describe('externalAuditStorageCta', () => { @@ -51,7 +49,7 @@ describe('externalAuditStorageCta', () => { }); cfg.isCloud = isCloud; - cfg.externalAuditStorage = lockedFeature; + cfg.externalAuditStorage = !lockedFeature; jest .spyOn(storageService, 'getExternalAuditStorageCtaDisabled') diff --git a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx index d5ce99e151135..ab3f050452409 100644 --- a/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx +++ b/web/packages/teleport/src/components/ExternalAuditStorageCta/ExternalAuditStorageCta.tsx @@ -40,7 +40,7 @@ import { ButtonLockedFeature } from '../ButtonLockedFeature'; export const ExternalAuditStorageCta = () => { const [showCta, setShowCta] = useState(false); const ctx = useTeleport(); - const featureEnabled = !cfg.externalAuditStorage; + const featureEnabled = cfg.externalAuditStorage; const userHasAccess = ctx.getFeatureFlags().enrollIntegrationsOrPlugins; useEffect(() => { @@ -49,7 +49,7 @@ export const ExternalAuditStorageCta = () => { cfg.isCloud && !storageService.getExternalAuditStorageCtaDisabled() ); - }, [cfg.isCloud]); + }, [ctx.hasExternalAuditStorage]); function handleDismiss() { storageService.disableExternalAuditStorageCta();