You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

389 lines
19 KiB

  1. Feature: delete
  2. Background:
  3. Given user "participant1" exists
  4. Given user "participant2" exists
  5. Given user "participant3" exists
  6. Scenario: delete share with an owned one-to-one room
  7. Given user "participant1" creates room "own one-to-one room" (v4)
  8. | roomType | 1 |
  9. | invite | participant2 |
  10. And user "participant1" shares "welcome.txt" with room "own one-to-one room" with OCS 100
  11. When user "participant1" deletes last share
  12. Then the OCS status code should be "100"
  13. And the HTTP status code should be "200"
  14. And user "participant1" gets last share
  15. And the OCS status code should be "404"
  16. And user "participant2" gets last share
  17. And the OCS status code should be "404"
  18. Scenario: delete share with a one-to-one room invited to
  19. Given user "participant2" creates room "one-to-one room invited to" (v4)
  20. | roomType | 1 |
  21. | invite | participant1 |
  22. And user "participant1" shares "welcome.txt" with room "one-to-one room invited to" with OCS 100
  23. When user "participant1" deletes last share
  24. Then the OCS status code should be "100"
  25. And the HTTP status code should be "200"
  26. And user "participant1" gets last share
  27. And the OCS status code should be "404"
  28. And user "participant2" gets last share
  29. And the OCS status code should be "404"
  30. Scenario: delete share with an owned group room
  31. Given user "participant1" creates room "own group room" (v4)
  32. | roomType | 2 |
  33. | roomName | room |
  34. And user "participant1" adds user "participant2" to room "own group room" with 200 (v4)
  35. And user "participant1" shares "welcome.txt" with room "own group room" with OCS 100
  36. When user "participant1" deletes last share
  37. Then the OCS status code should be "100"
  38. And the HTTP status code should be "200"
  39. And user "participant1" gets last share
  40. And the OCS status code should be "404"
  41. And user "participant2" gets last share
  42. And the OCS status code should be "404"
  43. Scenario: delete share with a group room invited to
  44. Given user "participant2" creates room "group room invited to" (v4)
  45. | roomType | 2 |
  46. | roomName | room |
  47. And user "participant2" adds user "participant1" to room "group room invited to" with 200 (v4)
  48. And user "participant1" shares "welcome.txt" with room "group room invited to" with OCS 100
  49. When user "participant1" deletes last share
  50. Then the OCS status code should be "100"
  51. And the HTTP status code should be "200"
  52. And user "participant1" gets last share
  53. And the OCS status code should be "404"
  54. And user "participant2" gets last share
  55. And the OCS status code should be "404"
  56. Scenario: delete share with an owned public room
  57. Given user "participant1" creates room "own public room" (v4)
  58. | roomType | 3 |
  59. | roomName | room |
  60. And user "participant1" adds user "participant2" to room "own public room" with 200 (v4)
  61. And user "participant3" joins room "own public room" with 200 (v4)
  62. And user "participant1" shares "welcome.txt" with room "own public room" with OCS 100
  63. When user "participant1" deletes last share
  64. Then the OCS status code should be "100"
  65. And the HTTP status code should be "200"
  66. And user "participant1" gets last share
  67. And the OCS status code should be "404"
  68. And user "participant2" gets last share
  69. And the OCS status code should be "404"
  70. And user "participant3" gets last share
  71. And the OCS status code should be "404"
  72. Scenario: delete share with a public room invited to
  73. Given user "participant2" creates room "public room invited to" (v4)
  74. | roomType | 3 |
  75. | roomName | room |
  76. And user "participant2" adds user "participant1" to room "public room invited to" with 200 (v4)
  77. And user "participant3" joins room "public room invited to" with 200 (v4)
  78. And user "participant1" shares "welcome.txt" with room "public room invited to" with OCS 100
  79. When user "participant1" deletes last share
  80. Then the OCS status code should be "100"
  81. And the HTTP status code should be "200"
  82. And user "participant1" gets last share
  83. And the OCS status code should be "404"
  84. And user "participant2" gets last share
  85. And the OCS status code should be "404"
  86. And user "participant3" gets last share
  87. And the OCS status code should be "404"
  88. Scenario: delete share with a public room self joined to
  89. Given user "participant2" creates room "public room self joined to" (v4)
  90. | roomType | 3 |
  91. | roomName | room |
  92. And user "participant1" joins room "public room self joined to" with 200 (v4)
  93. And user "participant3" joins room "public room self joined to" with 200 (v4)
  94. And user "participant1" shares "welcome.txt" with room "public room self joined to" with OCS 100
  95. When user "participant1" deletes last share
  96. Then the OCS status code should be "100"
  97. And the HTTP status code should be "200"
  98. And user "participant1" gets last share
  99. And the OCS status code should be "404"
  100. And user "participant2" gets last share
  101. And the OCS status code should be "404"
  102. And user "participant3" gets last share
  103. And the OCS status code should be "404"
  104. Scenario: delete (unknown) share with a one-to-one room not invited to
  105. Given user "participant2" creates room "one-to-one room not invited to" (v4)
  106. | roomType | 1 |
  107. | invite | participant3 |
  108. And user "participant2" shares "welcome.txt" with room "one-to-one room not invited to" with OCS 100
  109. When user "participant1" deletes last share
  110. Then the OCS status code should be "404"
  111. And the HTTP status code should be "200"
  112. And user "participant2" gets last share
  113. And share is returned with
  114. | uid_owner | participant2 |
  115. | displayname_owner | participant2-displayname |
  116. | path | /welcome.txt |
  117. | item_type | file |
  118. | mimetype | text/plain |
  119. | storage_id | home::participant2 |
  120. | file_target | /{TALK_PLACEHOLDER}/welcome.txt |
  121. | share_with | one-to-one room not invited to |
  122. | share_with_displayname | participant3-displayname |
  123. And user "participant3" gets last share
  124. And share is returned with
  125. | uid_owner | participant2 |
  126. | displayname_owner | participant2-displayname |
  127. | path | /Talk/welcome.txt |
  128. | item_type | file |
  129. | mimetype | text/plain |
  130. | storage_id | shared::/Talk/welcome.txt |
  131. | file_target | /Talk/welcome.txt |
  132. | share_with | one-to-one room not invited to |
  133. | share_with_displayname | participant2-displayname |
  134. Scenario: delete (unknown) share with a group room not invited to
  135. Given user "participant2" creates room "group room not invited to" (v4)
  136. | roomType | 2 |
  137. | roomName | room |
  138. And user "participant2" renames room "group room not invited to" to "Group room not invited to" with 200 (v4)
  139. And user "participant2" adds user "participant3" to room "group room not invited to" with 200 (v4)
  140. And user "participant2" shares "welcome.txt" with room "group room not invited to" with OCS 100
  141. When user "participant1" deletes last share
  142. Then the OCS status code should be "404"
  143. And the HTTP status code should be "200"
  144. And user "participant2" gets last share
  145. And share is returned with
  146. | uid_owner | participant2 |
  147. | displayname_owner | participant2-displayname |
  148. | path | /welcome.txt |
  149. | item_type | file |
  150. | mimetype | text/plain |
  151. | storage_id | home::participant2 |
  152. | file_target | /{TALK_PLACEHOLDER}/welcome.txt |
  153. | share_with | group room not invited to |
  154. | share_with_displayname | Group room not invited to |
  155. And user "participant3" gets last share
  156. And share is returned with
  157. | uid_owner | participant2 |
  158. | displayname_owner | participant2-displayname |
  159. | path | /Talk/welcome.txt |
  160. | item_type | file |
  161. | mimetype | text/plain |
  162. | storage_id | shared::/Talk/welcome.txt |
  163. | file_target | /Talk/welcome.txt |
  164. | share_with | group room not invited to |
  165. | share_with_displayname | Group room not invited to |
  166. Scenario: delete (unknown) share with a public room not joined to
  167. Given user "participant2" creates room "public room not joined to" (v4)
  168. | roomType | 3 |
  169. | roomName | room |
  170. And user "participant2" renames room "public room not joined to" to "Public room not joined to" with 200 (v4)
  171. And user "participant2" adds user "participant3" to room "public room not joined to" with 200 (v4)
  172. And user "participant2" shares "welcome.txt" with room "public room not joined to" with OCS 100
  173. When user "participant1" deletes last share
  174. Then the OCS status code should be "404"
  175. And the HTTP status code should be "200"
  176. And user "participant2" gets last share
  177. And share is returned with
  178. | uid_owner | participant2 |
  179. | displayname_owner | participant2-displayname |
  180. | path | /welcome.txt |
  181. | item_type | file |
  182. | mimetype | text/plain |
  183. | storage_id | home::participant2 |
  184. | file_target | /{TALK_PLACEHOLDER}/welcome.txt |
  185. | share_with | public room not joined to |
  186. | share_with_displayname | Public room not joined to |
  187. | token | A_TOKEN |
  188. And user "participant3" gets last share
  189. And share is returned with
  190. | uid_owner | participant2 |
  191. | displayname_owner | participant2-displayname |
  192. | path | /Talk/welcome.txt |
  193. | item_type | file |
  194. | mimetype | text/plain |
  195. | storage_id | shared::/Talk/welcome.txt |
  196. | file_target | /Talk/welcome.txt |
  197. | share_with | public room not joined to |
  198. | share_with_displayname | Public room not joined to |
  199. | token | A_TOKEN |
  200. Scenario: delete share with a user who also received that share through a room
  201. Given user "participant1" creates room "group room" (v4)
  202. | roomType | 2 |
  203. | roomName | room |
  204. And user "participant1" renames room "group room" to "Group room" with 200 (v4)
  205. And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
  206. And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
  207. And user "participant1" shares "welcome.txt" with user "participant2" with OCS 100
  208. And user "participant2" accepts last share
  209. When user "participant1" deletes last share
  210. Then the OCS status code should be "100"
  211. And the HTTP status code should be "200"
  212. And user "participant2" gets all received shares
  213. And the list of returned shares has 1 shares
  214. And share 0 is returned with
  215. | uid_owner | participant1 |
  216. | displayname_owner | participant1-displayname |
  217. | path | /Talk/welcome.txt |
  218. | item_type | file |
  219. | mimetype | text/plain |
  220. | storage_id | shared::/Talk/welcome.txt |
  221. | file_target | /Talk/welcome.txt |
  222. | share_with | group room |
  223. | share_with_displayname | Group room |
  224. Scenario: delete share with a room including a user who also received that share directly
  225. Given user "participant1" creates room "group room" (v4)
  226. | roomType | 2 |
  227. | roomName | room |
  228. And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
  229. And user "participant1" shares "welcome.txt" with user "participant2" with OCS 100
  230. And user "participant2" accepts last share
  231. And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
  232. When user "participant1" deletes last share
  233. Then the OCS status code should be "100"
  234. And the HTTP status code should be "200"
  235. And user "participant2" gets all received shares
  236. And the list of returned shares has 1 shares
  237. And share 0 is returned with
  238. | uid_owner | participant1 |
  239. | displayname_owner | participant1-displayname |
  240. | path | /welcome (2).txt |
  241. | item_type | file |
  242. | mimetype | text/plain |
  243. | storage_id | shared::/welcome (2).txt |
  244. | file_target | /welcome (2).txt |
  245. | share_with | participant2 |
  246. | share_with_displayname | participant2-displayname |
  247. | share_type | 0 |
  248. Scenario: delete received share
  249. Given user "participant1" creates room "group room" (v4)
  250. | roomType | 2 |
  251. | roomName | room |
  252. And user "participant1" renames room "group room" to "Group room" with 200 (v4)
  253. And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
  254. And user "participant1" adds user "participant3" to room "group room" with 200 (v4)
  255. And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
  256. When user "participant2" deletes last share
  257. Then the OCS status code should be "100"
  258. And the HTTP status code should be "200"
  259. And user "participant2" gets last share
  260. And the OCS status code should be "404"
  261. And user "participant1" gets last share
  262. And share is returned with
  263. | uid_owner | participant1 |
  264. | displayname_owner | participant1-displayname |
  265. | path | /welcome.txt |
  266. | item_type | file |
  267. | mimetype | text/plain |
  268. | storage_id | home::participant1 |
  269. | file_target | /{TALK_PLACEHOLDER}/welcome.txt |
  270. | share_with | group room |
  271. | share_with_displayname | Group room |
  272. And user "participant3" gets last share
  273. And share is returned with
  274. | uid_owner | participant1 |
  275. | displayname_owner | participant1-displayname |
  276. | path | /Talk/welcome.txt |
  277. | item_type | file |
  278. | mimetype | text/plain |
  279. | storage_id | shared::/Talk/welcome.txt |
  280. | file_target | /Talk/welcome.txt |
  281. | share_with | group room |
  282. | share_with_displayname | Group room |
  283. Scenario: delete share received directly and through a room
  284. Given user "participant1" creates room "group room" (v4)
  285. | roomType | 2 |
  286. | roomName | room |
  287. And user "participant1" renames room "group room" to "Group room" with 200 (v4)
  288. And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
  289. And user "participant1" adds user "participant3" to room "group room" with 200 (v4)
  290. And user "participant1" shares "welcome.txt" with user "participant2" with OCS 100
  291. And user "participant2" accepts last share
  292. And user "participant1" shares "welcome.txt" with room "group room" with OCS 100
  293. When user "participant2" deletes last share
  294. Then the OCS status code should be "100"
  295. And the HTTP status code should be "200"
  296. And user "participant2" gets last share
  297. And the OCS status code should be "404"
  298. And user "participant1" gets last share
  299. And share is returned with
  300. | uid_owner | participant1 |
  301. | displayname_owner | participant1-displayname |
  302. | path | /welcome.txt |
  303. | item_type | file |
  304. | mimetype | text/plain |
  305. | storage_id | home::participant1 |
  306. | file_target | /{TALK_PLACEHOLDER}/welcome.txt |
  307. | share_with | group room |
  308. | share_with_displayname | Group room |
  309. And user "participant3" gets last share
  310. And share is returned with
  311. | uid_owner | participant1 |
  312. | displayname_owner | participant1-displayname |
  313. | path | /Talk/welcome.txt |
  314. | item_type | file |
  315. | mimetype | text/plain |
  316. | storage_id | shared::/Talk/welcome.txt |
  317. | file_target | /Talk/welcome.txt |
  318. | share_with | group room |
  319. | share_with_displayname | Group room |
  320. And user "participant2" gets all received shares
  321. And the list of returned shares has 1 shares
  322. And share 0 is returned with
  323. | uid_owner | participant1 |
  324. | displayname_owner | participant1-displayname |
  325. | path | /welcome (2).txt |
  326. | item_type | file |
  327. | mimetype | text/plain |
  328. | storage_id | shared::/welcome (2).txt |
  329. | file_target | /welcome (2).txt |
  330. | share_with | participant2 |
  331. | share_with_displayname | participant2-displayname |
  332. | share_type | 0 |
  333. Scenario: Delete file in app Files and don't receive the deleted file when list the shared files with "file" format
  334. Given user "participant1" creates room "public room" (v4)
  335. | roomType | 3 |
  336. | roomName | room |
  337. And user "participant1" shares "welcome.txt" with room "public room" with OCS 100
  338. And user "participant1" sees the following messages in room "public room" with 200
  339. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  340. | public room | users | participant1 | participant1-displayname | {file} | "IGNORE" |
  341. And user "participant1" sees the following shared summarized overview in room "public room" with 200
  342. | audio | 0 |
  343. | deckcard | 0 |
  344. | file | 1 |
  345. | location | 0 |
  346. | media | 0 |
  347. | other | 0 |
  348. | poll | 0 |
  349. | voice | 0 |
  350. | recording | 0 |
  351. When user "participant1" deletes file "welcome.txt"
  352. Then user "participant1" sees the following shared file in room "public room" with 200
  353. And user "participant1" sees the following shared summarized overview in room "public room" with 200
  354. | audio | 0 |
  355. | deckcard | 0 |
  356. | file | 0 |
  357. | location | 0 |
  358. | media | 0 |
  359. | other | 0 |
  360. | poll | 0 |
  361. | voice | 0 |
  362. | recording | 0 |
  363. And user "participant1" sees the following messages in room "public room" with 200
  364. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  365. | public room | users | participant1 | participant1-displayname | *You shared a file which is no longer available* | {"actor":{"type":"user","id":"participant1","name":"participant1-displayname","mention-id":"participant1"}} |