Skip to content

Commit cd37fca

Browse files
committed
Also test archived = TRUE
1 parent 7a93fc7 commit cd37fca

File tree

2 files changed

+206
-0
lines changed

2 files changed

+206
-0
lines changed

tests/testthat/_snaps/api-spaces.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,194 @@
186186
187187
188188

189+
---
190+
191+
Code
192+
cu_get_spaces("1234", archived = TRUE)
193+
Output
194+
$spaces
195+
$spaces[[1]]
196+
$spaces[[1]]$id
197+
[1] "790"
198+
199+
$spaces[[1]]$name
200+
[1] "Updated Space Name"
201+
202+
$spaces[[1]]$private
203+
[1] FALSE
204+
205+
$spaces[[1]]$statuses
206+
$spaces[[1]]$statuses[[1]]
207+
$spaces[[1]]$statuses[[1]]$status
208+
[1] "to do"
209+
210+
$spaces[[1]]$statuses[[1]]$type
211+
[1] "open"
212+
213+
$spaces[[1]]$statuses[[1]]$orderindex
214+
[1] 0
215+
216+
$spaces[[1]]$statuses[[1]]$color
217+
[1] "#d3d3d3"
218+
219+
220+
$spaces[[1]]$statuses[[2]]
221+
$spaces[[1]]$statuses[[2]]$status
222+
[1] "complete"
223+
224+
$spaces[[1]]$statuses[[2]]$type
225+
[1] "closed"
226+
227+
$spaces[[1]]$statuses[[2]]$orderindex
228+
[1] 1
229+
230+
$spaces[[1]]$statuses[[2]]$color
231+
[1] "#6bc950"
232+
233+
234+
235+
$spaces[[1]]$multiple_assignees
236+
[1] FALSE
237+
238+
$spaces[[1]]$features
239+
$spaces[[1]]$features$due_dates
240+
$spaces[[1]]$features$due_dates$enabled
241+
[1] FALSE
242+
243+
$spaces[[1]]$features$due_dates$start_date
244+
[1] FALSE
245+
246+
$spaces[[1]]$features$due_dates$remap_due_dates
247+
[1] FALSE
248+
249+
$spaces[[1]]$features$due_dates$remap_closed_due_date
250+
[1] FALSE
251+
252+
253+
$spaces[[1]]$features$time_tracking
254+
$spaces[[1]]$features$time_tracking$enabled
255+
[1] FALSE
256+
257+
258+
$spaces[[1]]$features$tags
259+
$spaces[[1]]$features$tags$enabled
260+
[1] FALSE
261+
262+
263+
$spaces[[1]]$features$time_estimates
264+
$spaces[[1]]$features$time_estimates$enabled
265+
[1] FALSE
266+
267+
268+
$spaces[[1]]$features$checklists
269+
$spaces[[1]]$features$checklists$enabled
270+
[1] TRUE
271+
272+
273+
$spaces[[1]]$features$custom_fields
274+
$spaces[[1]]$features$custom_fields$enabled
275+
[1] TRUE
276+
277+
278+
$spaces[[1]]$features$remap_dependencies
279+
$spaces[[1]]$features$remap_dependencies$enabled
280+
[1] FALSE
281+
282+
283+
$spaces[[1]]$features$dependency_warning
284+
$spaces[[1]]$features$dependency_warning$enabled
285+
[1] FALSE
286+
287+
288+
$spaces[[1]]$features$portfolios
289+
$spaces[[1]]$features$portfolios$enabled
290+
[1] FALSE
291+
292+
293+
294+
295+
$spaces[[2]]
296+
$spaces[[2]]$id
297+
[1] "791"
298+
299+
$spaces[[2]]$name
300+
[1] "Second Space Name"
301+
302+
$spaces[[2]]$private
303+
[1] FALSE
304+
305+
$spaces[[2]]$statuses
306+
$spaces[[2]]$statuses[[1]]
307+
$spaces[[2]]$statuses[[1]]$status
308+
[1] "Open"
309+
310+
$spaces[[2]]$statuses[[1]]$type
311+
[1] "open"
312+
313+
$spaces[[2]]$statuses[[1]]$orderindex
314+
[1] 0
315+
316+
$spaces[[2]]$statuses[[1]]$color
317+
[1] "#d3d3d3"
318+
319+
320+
$spaces[[2]]$statuses[[2]]
321+
$spaces[[2]]$statuses[[2]]$status
322+
[1] "Closed"
323+
324+
$spaces[[2]]$statuses[[2]]$type
325+
[1] "closed"
326+
327+
$spaces[[2]]$statuses[[2]]$orderindex
328+
[1] 1
329+
330+
$spaces[[2]]$statuses[[2]]$color
331+
[1] "#6bc950"
332+
333+
334+
335+
$spaces[[2]]$multiple_assignees
336+
[1] TRUE
337+
338+
$spaces[[2]]$features
339+
$spaces[[2]]$features$due_dates
340+
$spaces[[2]]$features$due_dates$enabled
341+
[1] TRUE
342+
343+
$spaces[[2]]$features$due_dates$start_date
344+
[1] FALSE
345+
346+
$spaces[[2]]$features$due_dates$remap_due_dates
347+
[1] FALSE
348+
349+
$spaces[[2]]$features$due_dates$remap_closed_due_date
350+
[1] FALSE
351+
352+
353+
$spaces[[2]]$features$time_tracking
354+
$spaces[[2]]$features$time_tracking$enabled
355+
[1] TRUE
356+
357+
358+
$spaces[[2]]$features$tags
359+
$spaces[[2]]$features$tags$enabled
360+
[1] TRUE
361+
362+
363+
$spaces[[2]]$features$time_estimates
364+
$spaces[[2]]$features$time_estimates$enabled
365+
[1] TRUE
366+
367+
368+
$spaces[[2]]$features$checklists
369+
$spaces[[2]]$features$checklists$enabled
370+
[1] TRUE
371+
372+
373+
374+
375+
376+
189377
# data frame output
190378

191379
Code
@@ -307,3 +495,14 @@
307495
1 FALSE
308496
2 NA
309497

498+
---
499+
500+
Code
501+
cuf_get_spaces("1234", archived = TRUE)
502+
Output
503+
# A tibble: 2 x 6
504+
id name private statuses multiple_assign~ features$due_da~
505+
<chr> <chr> <lgl> <list<tibble[,4]>> <lgl> <lgl>
506+
1 790 Updated Space Name FALSE [2 x 4] FALSE FALSE
507+
2 791 Second Space Name FALSE [2 x 4] TRUE TRUE
508+

tests/testthat/test-api-spaces.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ test_that("output", {
22
expect_snapshot({
33
cu_get_spaces("1234")
44
})
5+
# UPSTREAM: No new data here, suggest to add?
6+
expect_snapshot({
7+
cu_get_spaces("1234", archived = TRUE)
8+
})
59
})
610

711
test_that("data frame output", {
@@ -20,4 +24,7 @@ test_that("data frame output", {
2024
df_spaces$features$dependency_warning
2125
df_spaces$features$portfolios
2226
})
27+
expect_snapshot({
28+
cuf_get_spaces("1234", archived = TRUE)
29+
})
2330
})

0 commit comments

Comments
 (0)