Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(creature_template_model): change initial probability from 0 to 1 #3234

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}