Skip to content

Commit

Permalink
test for widget-factory for organic sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
vraja-pro committed Mar 7, 2025
1 parent 3f944a1 commit 5138d58
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/js/tests/dashboard/services/widget-factory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,17 @@ describe( "WidgetFactory", () => {

expect( widgetFactory.createWidget( { id: "organic-sessions-widget", type: "organicSessions" } ) ).toBeNull();
} );

test.each( "should not create a OrganicSessions widget when user has no permmission", () => {
dataProvider = new MockDataProvider( {
siteKitConfiguration: {
capabilities: {
viewAnalyticsData: false,
},
},
} );
widgetFactory = new WidgetFactory( dataProvider, remoteDataProvider );

expect( widgetFactory.createWidget( { id: "organic-sessions-widget", type: "organicSessions" } ) ).toBeNull();
} );
} );

0 comments on commit 5138d58

Please sign in to comment.