|
21 | 21 | */ |
22 | 22 | import { Provider as ViewContextProvider } from '@/js/components/Root/ViewContextContext'; |
23 | 23 | import { VIEW_CONTEXT_MAIN_DASHBOARD } from '@/js/googlesitekit/constants'; |
24 | | -import { CORE_USER } from '@/js/googlesitekit/datastore/user/constants'; |
25 | | -import { provideSiteConnection } from '@tests/js/utils'; |
| 24 | +import { |
| 25 | + CORE_USER, |
| 26 | + PERMISSION_READ_SHARED_MODULE_DATA, |
| 27 | +} from '@/js/googlesitekit/datastore/user/constants'; |
| 28 | +import { getMetaCapabilityPropertyName } from '@/js/googlesitekit/datastore/util/permissions'; |
| 29 | +import { MODULE_SLUG_ANALYTICS_4 } from '@/js/modules/analytics-4/constants'; |
| 30 | +import { MODULE_SLUG_SEARCH_CONSOLE } from '@/js/modules/search-console/constants'; |
| 31 | +import AnalyticsIcon from '@/svg/graphics/analytics.svg'; |
| 32 | +import SearchConsoleIcon from '@/svg/graphics/search-console.svg'; |
| 33 | +import { |
| 34 | + provideModuleRegistrations, |
| 35 | + provideModules, |
| 36 | + provideSiteConnection, |
| 37 | + provideUserCapabilities, |
| 38 | +} from '@tests/js/utils'; |
26 | 39 | import WithRegistrySetup from '@tests/js/WithRegistrySetup'; |
27 | 40 | import SetupUsingProxyViewOnly from './index'; |
28 | 41 |
|
@@ -50,6 +63,43 @@ export default { |
50 | 63 | .dispatch( CORE_USER ) |
51 | 64 | .receiveGetTracking( { enabled: false } ); |
52 | 65 |
|
| 66 | + provideUserCapabilities( registry, { |
| 67 | + [ getMetaCapabilityPropertyName( |
| 68 | + PERMISSION_READ_SHARED_MODULE_DATA, |
| 69 | + MODULE_SLUG_SEARCH_CONSOLE |
| 70 | + ) ]: true, |
| 71 | + [ getMetaCapabilityPropertyName( |
| 72 | + PERMISSION_READ_SHARED_MODULE_DATA, |
| 73 | + MODULE_SLUG_ANALYTICS_4 |
| 74 | + ) ]: true, |
| 75 | + } ); |
| 76 | + |
| 77 | + provideModules( registry, [ |
| 78 | + { |
| 79 | + slug: MODULE_SLUG_SEARCH_CONSOLE, |
| 80 | + active: true, |
| 81 | + connected: true, |
| 82 | + shareable: true, |
| 83 | + }, |
| 84 | + { |
| 85 | + slug: MODULE_SLUG_ANALYTICS_4, |
| 86 | + active: true, |
| 87 | + connected: true, |
| 88 | + shareable: true, |
| 89 | + }, |
| 90 | + ] ); |
| 91 | + |
| 92 | + provideModuleRegistrations( registry, [ |
| 93 | + { |
| 94 | + slug: MODULE_SLUG_SEARCH_CONSOLE, |
| 95 | + Icon: SearchConsoleIcon, |
| 96 | + }, |
| 97 | + { |
| 98 | + slug: MODULE_SLUG_ANALYTICS_4, |
| 99 | + Icon: AnalyticsIcon, |
| 100 | + }, |
| 101 | + ] ); |
| 102 | + |
53 | 103 | // Call story-specific setup. |
54 | 104 | if ( typeof args?.setupRegistry === 'function' ) { |
55 | 105 | args.setupRegistry( registry ); |
|
0 commit comments