User:LVL/Sandbox: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
LVL (talk | contribs)
Blanked the page
Tags: Blanking Manual revert
LVL (talk | contribs)
No edit summary
Line 1: Line 1:
== ItemData Module Tests (Pre-Deployment Check) ==


=== get_cost ===
*  **Valid item:** {{#invoke:ItemData|get_cost|Berserker}}
    *  (Expected: "3,200")
*  **Valid item with weird casing:** {{#invoke:ItemData|get_cost|bErSeRkEr}}
    *  (Expected: "3,200")
*  **Valid item with whitespace:** {{#invoke:ItemData|get_cost|  Berserker  }}
    *  (Expected: "3,200")
*  **Invalid item:** {{#invoke:ItemData|get_cost|This Item Does Not Exist}}
    *  (Expected: A red "Item Not Found" error)
*  **No item:** {{#invoke:ItemData|get_cost|}}
    *  (Expected: A red "Item Not Found" error)
=== get_type ===
*  **Weapon:** {{#invoke:ItemData|get_type|Active Reload}}
    *  (Expected: "Weapon" or its localized equivalent)
*  **Armor:** {{#invoke:ItemData|get_type|Witchmail}}
    *  (Expected: "Armor" or its localized equivalent)
*  **Tech:** {{#invoke:ItemData|get_type|Spirit Strike}}
    *  (Expected: "Tech" or its localized equivalent)
=== is_active ===
*  **Passive item:** {{#invoke:ItemData|is_active|Berserker}}
    *  (Expected: "false")
*  **Active item (Toggle):** {{#invoke:ItemData|is_active|Blood Tribute}}
    *  (Expected: "true")
*  **Active item (InstantCast):** {{#invoke:ItemData|is_active|Refresher}}
    *  (Expected: "true")
=== get_prop ===
*  **Simple property:** {{#invoke:ItemData|get_prop|Berserker|Tier}}
    *  (Expected: "3")
*  **Table property (ShopFilters):** {{#invoke:ItemData|get_prop|Armor Piercing Rounds|ShopFilters}}
    *  (Expected: "ClipSize, WeaponDamage")
*  **Property of a disabled item:** {{#invoke:ItemData|get_prop|Ablative Coat|MaxBulletResist}}
    *  (Expected: "30")
=== get_codename ===
*  **Get codename for "Refresher":** {{#invoke:ItemData|get_codename|Refresher}}
    *  (Expected: "upgrade_refresher")
*  **Get codename for "Witchmail":** {{#invoke:ItemData|get_codename|Witchmail}}
    *  (Expected: "upgrade_absorbing_armor")
=== get_component_name ===
*  **Item with components:** {{#invoke:ItemData|get_component_name|Vortex Web}}
    *  (Expected: The name of the item with codename "upgrade_containment". This will be blank if that item has no name.)
*  **Item without components:** {{#invoke:ItemData|get_component_name|Berserker}}
    *  (Expected: Blank)
=== get_scalar (Testing Current Data) ===
'''Note:''' This confirms the module correctly handles missing `SpiritScaling` data in the current JSON.
*  **Call for "Torment Pulse":** {{#invoke:ItemData|get_scalar|Torment Pulse|DamagePulseAmount}}
    *  (Expected: A red error message like "SpiritScaling data not found for "Torment Pulse"")
=== get_headcount ===
*  **Total enabled items:** {{#invoke:ItemData|get_headcount}}
    *  (Expected: A number representing the total count of enabled items with names in your full JSON.)
=== Integration Test (Using a common template) ===
*  **Transcluding a key template with a real, enabled item:**
    {{Infobox item|name=Witchmail}}
    *  (The entire infobox should render correctly.)
*  **Transcluding with a disabled item:**
    {{Infobox item|name=Ablative Coat}}
    *  (The infobox should still render, showing how the template handles disabled items.)

Revision as of 17:07, 7 August 2025

ItemData Module Tests (Pre-Deployment Check)

get_cost

  • **Valid item:** 3,200
   *   (Expected: "3,200")
  • **Valid item with weird casing:** Cannot format non-number value.
   *   (Expected: "3,200")
  • **Valid item with whitespace:** Cannot format non-number value.
   *   (Expected: "3,200")
  • **Invalid item:** Cannot format non-number value.
   *   (Expected: A red "Item Not Found" error)
  • **No item:** Cannot format non-number value.
   *   (Expected: A red "Item Not Found" error)

get_type

  • **Weapon:** Weapon
   *   (Expected: "Weapon" or its localized equivalent)
  • **Armor:** Vitality
   *   (Expected: "Armor" or its localized equivalent)
  • **Tech:** Spirit
   *   (Expected: "Tech" or its localized equivalent)

is_active

  • **Passive item:** false
   *   (Expected: "false")
  • **Active item (Toggle):** true
   *   (Expected: "true")
  • **Active item (InstantCast):** true
   *   (Expected: "true")

get_prop

  • **Simple property:** 3
   *   (Expected: "3")
  • **Table property (ShopFilters):** ClipSize, WeaponDamage
   *   (Expected: "ClipSize, WeaponDamage")
  • **Property of a disabled item:** Item Not Found.
   *   (Expected: "30")

get_codename

  • **Get codename for "Refresher":** upgrade_ability_refresher
   *   (Expected: "upgrade_refresher")
  • **Get codename for "Witchmail":** upgrade_absorbing_armor
   *   (Expected: "upgrade_absorbing_armor")

get_component_name

  • **Item with components:** Slowing Hex
   *   (Expected: The name of the item with codename "upgrade_containment". This will be blank if that item has no name.)
  • **Item without components:**
   *   (Expected: Blank)

get_scalar (Testing Current Data)

Note: This confirms the module correctly handles missing `SpiritScaling` data in the current JSON.

  • **Call for "Torment Pulse":** Script error: The function "get_scalar" does not exist.
   *   (Expected: A red error message like "SpiritScaling data not found for "Torment Pulse"")

get_headcount

  • **Total enabled items:** 0
   *   (Expected: A number representing the total count of enabled items with names in your full JSON.)

Integration Test (Using a common template)

  • **Transcluding a key template with a real, enabled item:**
   
[[File:{{{item_name}}}.png|144px|class=pageimage|alt=Image for the Deadlock item ]]
Cost SoulsCannot format non-number value.
Tier Item Not Found.
Internal name:
   *   (The entire infobox should render correctly.)
  • **Transcluding with a disabled item:**
   
[[File:{{{item_name}}}.png|144px|class=pageimage|alt=Image for the Deadlock item ]]
Cost SoulsCannot format non-number value.
Tier Item Not Found.
Internal name:
   *   (The infobox should still render, showing how the template handles disabled items.)