believer/movies-graphql-postgres

View on GitHub
lib/graphql/resolvers/mutations/__tests__/__snapshots__/insertMovie.spec.js.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`mutations/insertMovie should insert a movie 1`] = `
Object {
  "adult": false,
  "budget": 150000000,
  "homepage": "http://bladerunnermovie.com/",
  "imdb_id": "tt1856101",
  "overview": "Thirty years after the events of the first film, a new blade runner, LAPD Officer K, unearths a long-buried secret that has the potential to plunge what's left of society into chaos. K's discovery leads him on a quest to find Rick Deckard, a former LAPD blade runner who has been missing for 30 years.",
  "release_date": "2017-10-04",
  "runtime": 163,
  "tagline": "",
  "title": "Blade Runner 2049",
  "tmdb_id": 335984,
  "wilhelm": true,
}
`;

exports[`mutations/insertMovie should insert a movie 2`] = `
Array [
  "? ON CONFLICT ON CONSTRAINT movies_imdb_id_key
      DO UPDATE SET imdb_id='tt1856101' RETURNING *",
  Array [
    Object {
      "adult": false,
      "budget": 150000000,
      "homepage": "http://bladerunnermovie.com/",
      "imdb_id": "tt1856101",
      "overview": "Thirty years after the events of the first film, a new blade runner, LAPD Officer K, unearths a long-buried secret that has the potential to plunge what's left of society into chaos. K's discovery leads him on a quest to find Rick Deckard, a former LAPD blade runner who has been missing for 30 years.",
      "release_date": "2017-10-04",
      "runtime": 163,
      "tagline": "",
      "title": "Blade Runner 2049",
      "tmdb_id": 335984,
      "wilhelm": true,
    },
  ],
]
`;

exports[`mutations/insertMovie should insert a rating if rating is set 1`] = `
"
        INSERT INTO ratings (movie_id, user_id, rating)
        VALUES ($1, $2, $3)
        ON CONFLICT
        ON CONSTRAINT ratings_pkey DO UPDATE SET rating=EXCLUDED.rating
      "
`;

exports[`mutations/insertMovie should return the inserted movie 1`] = `
Object {
  "id": "1337",
}
`;