Skip to content

Commit

Permalink
Merge branch 'master' into pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Exitare authored Jan 8, 2025
2 parents 1dc1900 + 3a6646e commit 9d9cbdd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ describe('CreatureTemplateModel integration tests', () => {
const expectedQuery =
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (0, 1, 2));\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0),\n' +
'(1234, 1, 0, 1, 0, 0),\n' +
'(1234, 2, 0, 1, 0, 0);';
'(1234, 0, 0, 1, 1, 0),\n' +
'(1234, 1, 0, 1, 1, 0),\n' +
'(1234, 2, 0, 1, 1, 0);';
querySpy.calls.reset();

page.addNewRow();
Expand All @@ -127,25 +127,25 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectDiffQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (0));\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0);',
'(1234, 0, 0, 1, 1, 0);',
);
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0)',
'(1234, 0, 0, 1, 1, 0)',
);

page.setInputValueById('Idx', '28');

page.expectDiffQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (28));\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 28, 0, 1, 0, 0);',
'(1234, 28, 0, 1, 1, 0);',
);
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 28, 0, 1, 0, 0);',
'(1234, 28, 0, 1, 1, 0);',
);
page.removeNativeElement();
});
Expand All @@ -161,14 +161,14 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectDiffQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (28, 0));\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 28, 0, 1, 0, 0),\n' +
'(1234, 0, 0, 1, 0, 0);',
'(1234, 28, 0, 1, 1, 0),\n' +
'(1234, 0, 0, 1, 1, 0);',
);
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 28, 0, 1, 0, 0),\n' +
'(1234, 0, 0, 1, 0, 0);',
'(1234, 28, 0, 1, 1, 0),\n' +
'(1234, 0, 0, 1, 1, 0);',
);
page.removeNativeElement();
});
Expand All @@ -183,9 +183,9 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0),\n' +
'(1234, 1, 0, 1, 0, 0),\n' +
'(1234, 2, 0, 1, 0, 0);',
'(1234, 0, 0, 1, 1, 0),\n' +
'(1234, 1, 0, 1, 1, 0),\n' +
'(1234, 2, 0, 1, 1, 0);',
);
expect(page.getEditorTableRowsCount()).toBe(3);
expect(page.getAllModelViewers().length).toBe(3); // check one model viewer per row
Expand All @@ -199,8 +199,8 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectDiffQueryToContain('DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (1));');
page.expectFullQueryToContain(
'creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0),\n' +
'(1234, 2, 0, 1, 0, 0);',
'(1234, 0, 0, 1, 1, 0),\n' +
'(1234, 2, 0, 1, 1, 0);',
);

page.deleteRow(1);
Expand All @@ -209,7 +209,7 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0);',
'(1234, 0, 0, 1, 1, 0);',
);

page.deleteRow(0);
Expand All @@ -235,9 +235,9 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0),\n' +
'(1234, 0, 0, 1, 1, 0),\n' +
'(1234, 1, 1111, 222, 333, 0),\n' +
'(1234, 2, 0, 1, 0, 0);',
'(1234, 2, 0, 1, 1, 0);',
);
page.removeNativeElement();
});
Expand All @@ -258,15 +258,15 @@ describe('CreatureTemplateModel integration tests', () => {
page.expectDiffQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234) AND (`Idx` IN (1, 2, 28, 3));\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 28, 0, 1, 0, 0),\n' +
'(1234, 3, 0, 1, 0, 0);',
'(1234, 28, 0, 1, 1, 0),\n' +
'(1234, 3, 0, 1, 1, 0);',
);
page.expectFullQueryToContain(
'DELETE FROM `creature_template_model` WHERE (`CreatureID` = 1234);\n' +
'INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES\n' +
'(1234, 0, 0, 1, 0, 0),\n' +
'(1234, 28, 0, 1, 0, 0),\n' +
'(1234, 3, 0, 1, 0, 0);',
'(1234, 0, 0, 1, 1, 0),\n' +
'(1234, 28, 0, 1, 1, 0),\n' +
'(1234, 3, 0, 1, 1, 0);',
);
page.removeNativeElement();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('CreatureTemplate integration tests', () => {
'`maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, ' +
'`RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, ' +
'`flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' +
"(1234, 0, 0, 0, 0, 0, '', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " +
"(1234, 0, 0, 0, 0, 0, '', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, " +
"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);\n";

const originalEntity = new CreatureTemplate();
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('CreatureTemplate integration tests', () => {
'`lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, ' +
'`AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, ' +
'`movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES\n' +
"(1234, 0, 0, 0, 0, 0, 'Shin', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0," +
"(1234, 0, 0, 0, 0, 0, 'Shin', '', '', 0, 1, 1, 0, 0, 0, 1, 1.14286, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0," +
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 0);";

querySpy.calls.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export class CreatureTemplateModel extends TableRow {
Idx: number = 0;
CreatureDisplayID: number = 0;
DisplayScale: number = 1;
Probability: number = 0;
Probability: number = 1;
VerifiedBuild: number = 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class CreatureTemplate extends TableRow {
RangeAttackTime: number = 0;
BaseVariance: number = 0;
RangeVariance: number = 0;
unit_class: number = 0;
unit_class: number = 1;
unit_flags: number = 0;
unit_flags2: number = 0;
dynamicflags: number = 0;
Expand Down

0 comments on commit 9d9cbdd

Please sign in to comment.