@@ -123,6 +123,72 @@ def test_snooze_legacy_path(self):
123
123
self .path = reverse ("sentry-api-0-prompts-activity" )
124
124
self .test_snooze ()
125
125
126
+ def test_visible (self ):
127
+ data = {
128
+ "organization_id" : self .org .id ,
129
+ "project_id" : self .project .id ,
130
+ "feature" : "releases" ,
131
+ }
132
+ resp = self .client .get (self .path , data )
133
+ assert resp .status_code == 200
134
+ assert resp .data .get ("data" , None ) is None
135
+
136
+ self .client .put (
137
+ self .path ,
138
+ {
139
+ "organization_id" : self .org .id ,
140
+ "project_id" : self .project .id ,
141
+ "feature" : "releases" ,
142
+ "status" : "visible" ,
143
+ },
144
+ )
145
+
146
+ resp = self .client .get (self .path , data )
147
+ assert resp .status_code == 200
148
+ assert "data" in resp .data
149
+ assert resp .data ["data" ].get ("dismissed_ts" ) is None
150
+ assert resp .data ["data" ].get ("snoozed_ts" ) is None
151
+
152
+ def test_visible_legacy_path (self ):
153
+ self .path = reverse ("sentry-api-0-prompts-activity" )
154
+ self .test_visible ()
155
+
156
+ def test_visible_after_dismiss (self ):
157
+ data = {
158
+ "organization_id" : self .org .id ,
159
+ "project_id" : self .project .id ,
160
+ "feature" : "releases" ,
161
+ }
162
+ resp = self .client .get (self .path , data )
163
+ assert resp .status_code == 200
164
+ assert resp .data .get ("data" , None ) is None
165
+
166
+ self .client .put (
167
+ self .path ,
168
+ {
169
+ "organization_id" : self .org .id ,
170
+ "project_id" : self .project .id ,
171
+ "feature" : "releases" ,
172
+ "status" : "dismiss" ,
173
+ },
174
+ )
175
+
176
+ self .client .put (
177
+ self .path ,
178
+ {
179
+ "organization_id" : self .org .id ,
180
+ "project_id" : self .project .id ,
181
+ "feature" : "releases" ,
182
+ "status" : "visible" ,
183
+ },
184
+ )
185
+
186
+ resp = self .client .get (self .path , data )
187
+ assert resp .status_code == 200
188
+ assert "data" in resp .data
189
+ assert resp .data ["data" ].get ("dismissed_ts" ) is None
190
+ assert resp .data ["data" ].get ("snoozed_ts" ) is None
191
+
126
192
def test_batched (self ):
127
193
data = {
128
194
"organization_id" : self .org .id ,
0 commit comments