From 947d35fbfbf297134462689089ca351d32d49538 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 9 Aug 2020 23:03:53 -0700 Subject: [PATCH] update test snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I skipped this in the past runs because I had a hard time getting consistency from the results… but they seem to be behaving now? It really seemed like there were some races on certain query orders… maybe there still is, but my more-reliable connection today is making them resolve in a more consistent order? Anyway if I see goofs again, I'll consider adding a snapshot matcher that isn't picky about query order 🤔 --- .../getValidPetPoses.test.js.snap | 12 ++-- src/server/query-tests/PetAppearance.test.js | 57 +++------------- .../__snapshots__/Item.test.js.snap | 15 ---- .../__snapshots__/PetAppearance.test.js.snap | 68 +------------------ .../SpeciesColorPair.test.js.snap | 48 +++++++++++++ 5 files changed, 63 insertions(+), 137 deletions(-) diff --git a/src/server/__snapshots__/getValidPetPoses.test.js.snap b/src/server/__snapshots__/getValidPetPoses.test.js.snap index 8baa862..46bbc1c 100644 --- a/src/server/__snapshots__/getValidPetPoses.test.js.snap +++ b/src/server/__snapshots__/getValidPetPoses.test.js.snap @@ -1434,7 +1434,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 00111111 00000000 00111111 -00000000 +10000000 10000000 00111111 10111011 @@ -2128,7 +2128,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 00000000 00000000 00000000 -00000000 +10000000 00000000 00000000 00000000 @@ -2658,7 +2658,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 00111111 00000000 00000000 -00000000 +10000000 00000000 00000000 00111111 @@ -4183,7 +4183,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 00111111 01111111 10111111 -00000000 +10000000 00000000 00111111 00000000 @@ -4685,7 +4685,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 00000000 10011111 00000000 -00000000 +10000000 10000000 10011111 10000000 @@ -5366,7 +5366,7 @@ exports[`getValidPetPoses gets them and writes them to a buffer 1`] = ` 10001111 10111111 00000000 -00000000 +10000000 00000000 00000000 00000000 diff --git a/src/server/query-tests/PetAppearance.test.js b/src/server/query-tests/PetAppearance.test.js index 6d52d50..85ec4f0 100644 --- a/src/server/query-tests/PetAppearance.test.js +++ b/src/server/query-tests/PetAppearance.test.js @@ -44,6 +44,14 @@ describe("PetAppearance", () => { "75", ], ], + Array [ + "SELECT * FROM pet_states + WHERE pet_type_id IN (?) AND glitched = 0 + ORDER BY (mood_id = 1) DESC", + Array [ + "2", + ], + ], Array [ "SELECT sa.*, rel.parent_id FROM swf_assets sa INNER JOIN parents_swf_assets rel ON @@ -85,14 +93,6 @@ describe("PetAppearance", () => { "34", ], ], - Array [ - "SELECT * FROM pet_states - WHERE pet_type_id IN (?) AND glitched = 0 - ORDER BY (mood_id = 1) DESC", - Array [ - "2", - ], - ], ] `); }); @@ -140,47 +140,6 @@ describe("PetAppearance", () => { "75", ], ], - Array [ - "SELECT sa.*, rel.parent_id FROM swf_assets sa - INNER JOIN parents_swf_assets rel ON - rel.parent_type = \\"PetState\\" AND - rel.swf_asset_id = sa.id - WHERE rel.parent_id IN (?)", - Array [ - "17723", - ], - ], - Array [ - "SELECT * FROM species_translations - WHERE species_id IN (?) AND locale = \\"en\\"", - Array [ - "54", - ], - ], - Array [ - "SELECT * FROM color_translations - WHERE color_id IN (?) AND locale = \\"en\\"", - Array [ - "75", - ], - ], - Array [ - "SELECT * FROM colors WHERE id IN (?) AND prank = 0", - Array [ - "75", - ], - ], - Array [ - "SELECT * FROM zones WHERE id IN (?,?,?,?,?,?)", - Array [ - "15", - "5", - "37", - "30", - "33", - "34", - ], - ], Array [ "SELECT * FROM pet_states WHERE pet_type_id IN (?) AND glitched = 0 diff --git a/src/server/query-tests/__snapshots__/Item.test.js.snap b/src/server/query-tests/__snapshots__/Item.test.js.snap index d41c3e2..63bf3cb 100644 --- a/src/server/query-tests/__snapshots__/Item.test.js.snap +++ b/src/server/query-tests/__snapshots__/Item.test.js.snap @@ -147,18 +147,3 @@ Object { ], } `; - -exports[`Item skips appearance data for audio assets 3`] = ` -Object { - "items": Array [ - Object { - "appearanceOn": Object { - "layers": Array [], - "restrictedZones": Array [], - }, - "id": "42829", - "name": "Time Tunnel Music Track", - }, - ], -} -`; diff --git a/src/server/query-tests/__snapshots__/PetAppearance.test.js.snap b/src/server/query-tests/__snapshots__/PetAppearance.test.js.snap index bf75eb1..b6b728e 100644 --- a/src/server/query-tests/__snapshots__/PetAppearance.test.js.snap +++ b/src/server/query-tests/__snapshots__/PetAppearance.test.js.snap @@ -1,72 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`PetAppearance loads for species and color 1`] = ` -Object { - "petAppearance": Object { - "color": Object { - "id": "75", - "name": "Starry", - }, - "id": "54-75-HAPPY_FEM", - "layers": Array [ - Object { - "id": "5995", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/007/7941/600x600.png?v2-0", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/007/7941_2c4cc4b846/7941.svg", - "zone": Object { - "depth": 18, - }, - }, - Object { - "id": "5996", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/007/7942/600x600.png?v2-0", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/007/7942_2eab06fd7b/7942.svg", - "zone": Object { - "depth": 7, - }, - }, - Object { - "id": "6000", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/007/7946/600x600.png?v2-0", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/007/7946_0348dad587/7946.svg", - "zone": Object { - "depth": 40, - }, - }, - Object { - "id": "16467", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/024/24008/600x600.png?v2-0", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/024/24008_a05fe9876a/24008.svg", - "zone": Object { - "depth": 34, - }, - }, - Object { - "id": "19784", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/028/28892/600x600.png?v2-1313418652000", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/028/28892_a8e3a8b430/28892.svg", - "zone": Object { - "depth": 37, - }, - }, - Object { - "id": "178150", - "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/036/36887/600x600.png?v2-1354240708000", - "svgUrl": "http://images.neopets.com/cp/bio/data/000/000/036/36887_a335fbba09/36887.svg", - "zone": Object { - "depth": 38, - }, - }, - ], - "species": Object { - "id": "54", - "name": "Zafara", - }, - }, -} -`; - -exports[`PetAppearance loads multiple for species and color 1`] = ` Object { "petAppearance": Object { "color": Object { @@ -133,7 +67,7 @@ Object { } `; -exports[`PetAppearance loads multiple for species and color 3`] = ` +exports[`PetAppearance loads multiple for species and color 1`] = ` Object { "petAppearances": Array [ Object { diff --git a/src/server/query-tests/__snapshots__/SpeciesColorPair.test.js.snap b/src/server/query-tests/__snapshots__/SpeciesColorPair.test.js.snap index 1d6c55e..1d6d636 100644 --- a/src/server/query-tests/__snapshots__/SpeciesColorPair.test.js.snap +++ b/src/server/query-tests/__snapshots__/SpeciesColorPair.test.js.snap @@ -7035,6 +7035,14 @@ Object { "id": "13", }, }, + Object { + "color": Object { + "id": "88", + }, + "species": Object { + "id": "13", + }, + }, Object { "color": Object { "id": "89", @@ -10219,6 +10227,14 @@ Object { "id": "19", }, }, + Object { + "color": Object { + "id": "110", + }, + "species": Object { + "id": "19", + }, + }, Object { "color": Object { "id": "-1", @@ -12771,6 +12787,14 @@ Object { "id": "24", }, }, + Object { + "color": Object { + "id": "80", + }, + "species": Object { + "id": "24", + }, + }, Object { "color": Object { "id": "83", @@ -19675,6 +19699,14 @@ Object { "id": "38", }, }, + Object { + "color": Object { + "id": "37", + }, + "species": Object { + "id": "38", + }, + }, Object { "color": Object { "id": "39", @@ -22043,6 +22075,14 @@ Object { "id": "42", }, }, + Object { + "color": Object { + "id": "91", + }, + "species": Object { + "id": "42", + }, + }, Object { "color": Object { "id": "92", @@ -25251,6 +25291,14 @@ Object { "id": "48", }, }, + Object { + "color": Object { + "id": "100", + }, + "species": Object { + "id": "48", + }, + }, Object { "color": Object { "id": "-1",