Skip to content

Commit

Permalink
feat: report manually init test
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Sep 27, 2023
1 parent ee05b67 commit 238b90b
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void getFeedbackWidgetData_garbageResult() {
init(config);

JSONObject responseJson = new JSONObject();
responseJson.put("resullt", "Success");
responseJson.put("result", "Success");

CountlyFeedbackWidget widgetInfo = createFeedbackWidget(FeedbackWidgetType.nps, "nps1", "npsID1", new String[] {});

Expand All @@ -357,6 +357,22 @@ public void getFeedbackWidgetData_garbageResult() {
});
}

/**
* Report feedback widget manually with null widget info
* "reportFeedbackWidgetManually" function should not record widget as an event,
* event queue should be empty
*/
@Test
public void reportFeedbackWidgetManually_nullWidgetInfo() {
Config config = TestUtils.getBaseConfig();
config.enableFeatures(Config.Feature.Feedback).setEventQueueSizeToSend(4);
init(config);

Countly.instance().feedback().reportFeedbackWidgetManually(null, null, null);
List<EventImpl> events = TestUtils.getCurrentEventQueue(TestUtils.getSdkStorageRootDirectory(), L);
Assert.assertEquals(0, events.size());
}

private void validateWidgetDataParams(Map<String, String> params, CountlyFeedbackWidget widgetInfo) {
Assert.assertEquals(widgetInfo.widgetId, params.get("widget_id"));
Assert.assertEquals("desktop", params.get("platform"));
Expand Down

0 comments on commit 238b90b

Please sign in to comment.