We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13f3dba commit d536561Copy full SHA for d536561
1 file changed
packages/react-native/src/lib/common/tests/utils.test.ts
@@ -158,6 +158,22 @@ describe("utils.ts", () => {
158
expect(result[0].id).toBe(mockSurveyId1);
159
});
160
161
+ test("filters out surveys that have a segment with filters if userId is not set", () => {
162
+ environment.data.surveys = [
163
+ {
164
+ ...baseSurvey,
165
+ id: mockSurveyId1,
166
+ segment: {
167
+ id: mockSegmentId1,
168
+ filters: [{ type: "string", key: "name", value: "John" }],
169
+ },
170
+ } as TSurvey,
171
+ ];
172
+
173
+ const result = filterSurveys(environment, user);
174
+ expect(result).toHaveLength(0);
175
+ });
176
177
test("skips surveys that already displayed if displayOnce is used", () => {
178
environment.data.surveys = [
179
{
0 commit comments