selkamand / ggoncoplot

Easily Create Interactive Oncoplots
https://selkamand.github.io/ggoncoplot/
Other
3 stars 0 forks source link

Add unit tests tests to ensure sample Ids are appropriately ordered as factors #7

Closed selkamand closed 2 years ago

selkamand commented 2 years ago

Already covered in dev. Could add something a little more explicit

expect_snapshot(x = levels(prepped_df[['Sample']]))
expect_snapshot(x = levels(prepped_df_no_mutation_type[['Sample']]))
selkamand commented 2 years ago

On second thought, i think this is perfectly sufficient given the number of samples. I will add explicit tests to ensure Sample column is a factor though

expect_type(prepped_df[['Sample']], type = "factor")
expect_type(prepped_df_no_mutation_type[['Sample']], type = "factor")
selkamand commented 2 years ago

wrong expect_ function. Final version as below

expect_s3_class(prepped_df[['Sample']], "factor")
expect_s3_class(prepped_df_no_mutation_type[['Sample']], "factor")

now in dev version