Skip to content

Commit

Permalink
wip - prisma 13097
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhoule committed Sep 13, 2022
1 parent a652eea commit a8fc378
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
@@ -1,5 +1,6 @@
mod max_integer;
mod prisma_10098;
mod prisma_13097;
mod prisma_10935;
mod prisma_12929;
mod prisma_14696;
Expand Down
@@ -0,0 +1,34 @@
use query_engine_tests::*;

#[test_suite(schema(schema), only(Postgres))]
mod prisma_13097 {
fn schema() -> String {
r#"
enum AppCategories {
calendar
messaging
payment
other
}
model App {
slug String @id @unique
categories AppCategories[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
"#
.to_owned()
}

#[connector_test]
async fn group_by_enum_array(runner: Runner) -> TestResult<()> {
// Insert some data first
run_query!(runner, r#"mutation { createManyApp(data: [{slug:"a",categories:[calendar,other]},{slug:"b",categories:[]},{slug:"c",categories:[calendar,other]},{slug:"d",categories:[messaging, payment]}]) { count } }"#);

let result = run_query!(runner, r#"{groupByApp(by: [categories, slug]) { slug categories }}"#);
assert_eq!(result, "meow");

Ok(())
}
}

0 comments on commit a8fc378

Please sign in to comment.