Skip to content

Commit

Permalink
chore(creature_template_model): change initial probability from 0 to 1 (
Browse files Browse the repository at this point in the history
#3234)

Co-authored-by: Stefano Borzì <[email protected]>
  • Loading branch information
Exitare and Helias authored Jan 8, 2025
1 parent 77a9b68 commit 3a6646e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 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 @@ -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;
}

0 comments on commit 3a6646e

Please sign in to comment.