Skip to content

Commit

Permalink
Merge branch 'main' into joel/docker-compose-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Apr 25, 2024
2 parents 3e8d68d + 5d2f494 commit 04470fd
Showing 1 changed file with 29 additions and 0 deletions.
Expand Up @@ -396,6 +396,35 @@ mod upsert {
Ok(())
}

#[connector_test(schema(schema), relation_mode = "prisma")]
async fn upsert_called_twice_does_nothing(runner: Runner) -> TestResult<()> {
assert_eq!(count_todo(&runner).await?, 0);

const MUTATION: &str = r#"mutation {
upsertOneTodo(
where: {id: 1}
create: {
id: 1,
title: "title"
alias: "alias"
}
update: {
title: { set: "title" }
}
){
id
title
}
}"#;

insta::assert_snapshot!(run_query!(&runner, MUTATION), @r#"{"data":{"upsertOneTodo":{"id":1,"title":"title"}}}"#);
insta::assert_snapshot!(run_query!(&runner, MUTATION), @r#"{"data":{"upsertOneTodo":{"id":1,"title":"title"}}}"#);

assert_eq!(count_todo(&runner).await?, 1);

Ok(())
}

fn schema_number() -> String {
let schema = indoc! {
r#"model TestModel {
Expand Down

0 comments on commit 04470fd

Please sign in to comment.