Add location to tests

This commit is contained in:
2024-10-26 14:55:25 +01:00
parent 5a47aecb70
commit ba5a75f855
2 changed files with 20 additions and 19 deletions

2
package-lock.json generated
View File

@@ -13017,7 +13017,6 @@
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz",
"integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
@@ -13380,7 +13379,6 @@
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz",
"integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"

View File

@@ -11,6 +11,7 @@ describe('EventManager', function () {
const EVENT_NAME = 'Test Event';
const EVENT_DESCRIPTION = 'This is a test event';
const EVENT_LOCATION = 'London, UK';
const EVENT_CAPACITY = 100;
const EVENT_TICKET_PRICE = 1000; // 10 USD in cents
const EVENT_DATE = Math.floor(Date.now() / 1000) + 86400; // 1 day from now
@@ -28,6 +29,7 @@ describe('EventManager', function () {
await eventManager.createEvent(
EVENT_NAME,
EVENT_DESCRIPTION,
EVENT_LOCATION,
EVENT_CAPACITY,
EVENT_TICKET_PRICE,
EVENT_DATE,
@@ -35,25 +37,26 @@ describe('EventManager', function () {
);
}
// describe("Event Creation", function () {
// it("Should create an event with correct details", async function () {
// await createTestEvent();
describe("Event Creation", function () {
it("Should create an event with correct details", async function () {
await createTestEvent();
// const event = await eventManager.events(0);
// expect(event.name).to.equal(EVENT_NAME);
// expect(event.description).to.equal(EVENT_DESCRIPTION);
// expect(event.capacity).to.equal(EVENT_CAPACITY);
// expect(event.ticketPrice).to.equal(EVENT_TICKET_PRICE);
// expect(event.eventDate).to.equal(EVENT_DATE);
// expect(event.eventHost).to.equal(owner.address);
// });
const event = await eventManager.events(0);
expect(event.name).to.equal(EVENT_NAME);
expect(event.description).to.equal(EVENT_DESCRIPTION);
expect(event.location).to.equal(EVENT_LOCATION);
expect(event.capacity).to.equal(EVENT_CAPACITY);
expect(event.ticketPrice).to.equal(EVENT_TICKET_PRICE);
expect(event.eventDate).to.equal(EVENT_DATE);
expect(event.eventHost).to.equal(owner.address);
});
// it("Should emit EventCreated event", async function () {
// await expect(await createTestEvent())
// .to.emit(eventManager, "EventCreated")
// .withArgs(0, EVENT_NAME, EVENT_DATE);
// });
// });
});
describe('Ticket Purchase', function () {
beforeEach(async function () {