diff --git a/test/server/middleware/auth/login.test.js b/test/server/middleware/auth/login.test.js index 723c40b..ae88592 100644 --- a/test/server/middleware/auth/login.test.js +++ b/test/server/middleware/auth/login.test.js @@ -2,12 +2,12 @@ import { beforeEach, describe, it, vi } from 'vitest'; import { createRequest, createResponse } from 'node-mocks-http'; import SQLite from '../../../../server/database/sqlite/setup'; import login from '../../../../server/middleware/auth/login'; -import { setServerSideCookie } from '../../../../server/utils/cookies'; +import { setServerSideCookie } from '../../../../shared/utils/cookies'; import { signInUser } from '../../../../server/database/queries/user'; vi.mock('../../../../server/database/sqlite/setup'); vi.mock('../../../../server/database/queries/user'); -vi.mock('../../../../server/utils/cookies'); +vi.mock('../../../../shared/utils/cookies'); describe('Login - Middleware', () => { const user = { diff --git a/test/server/middleware/auth/logout.test.js b/test/server/middleware/auth/logout.test.js index c0cdcb5..94efb2e 100644 --- a/test/server/middleware/auth/logout.test.js +++ b/test/server/middleware/auth/logout.test.js @@ -1,9 +1,9 @@ import { createRequest, createResponse } from 'node-mocks-http'; -import { deleteCookie } from '../../../../server/utils/cookies'; +import { deleteCookie } from '../../../../shared/utils/cookies'; import logout from '../../../../server/middleware/auth/logout'; -import { createURL } from '../../../../server/utils/url'; +import { createURL } from '../../../../shared/utils/url'; -vi.mock('../../../../server/utils/cookies'); +vi.mock('../../../../shared/utils/cookies'); describe('Logout - Middleware', () => { let fakeRequest; diff --git a/test/server/middleware/auth/register.test.js b/test/server/middleware/auth/register.test.js index 5e86d90..343b16e 100644 --- a/test/server/middleware/auth/register.test.js +++ b/test/server/middleware/auth/register.test.js @@ -5,10 +5,10 @@ import { fetchMembers, registerUser, } from '../../../../server/database/queries/user'; -import { setServerSideCookie } from '../../../../server/utils/cookies'; +import { setServerSideCookie } from '../../../../shared/utils/cookies'; vi.mock('../../../../server/database/queries/user'); -vi.mock('../../../../server/utils/cookies'); +vi.mock('../../../../shared/utils/cookies'); describe('Register - Middleware', () => { let fakeRequest; diff --git a/test/server/middleware/authorization.test.js b/test/server/middleware/authorization.test.js index 39c23fc..12e57ab 100644 --- a/test/server/middleware/authorization.test.js +++ b/test/server/middleware/authorization.test.js @@ -2,10 +2,10 @@ import { createRequest, createResponse } from 'node-mocks-http'; import { afterEach, beforeEach, describe, it, vi } from 'vitest'; import { userExists } from '../../../server/database/queries/user'; import authorization from '../../../server/middleware/authorization'; -import { deleteCookie } from '../../../server/utils/cookies'; +import { deleteCookie } from '../../../shared/utils/cookies'; vi.mock('../../../server/database/queries/user'); -vi.mock('../../../server/utils/cookies'); +vi.mock('../../../shared/utils/cookies'); describe('Authorization - Middleware', () => { let fakeRequest; diff --git a/test/server/middleware/user/access/approve.test.js b/test/server/middleware/user/access/approve.test.js index c048f46..d382d6a 100644 --- a/test/server/middleware/user/access/approve.test.js +++ b/test/server/middleware/user/access/approve.test.js @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { createRequest, createResponse } from 'node-mocks-http'; import { approveAccess } from '../../../../../server/database/queries/user'; import accessApproveMiddleware from '../../../../../server/middleware/user/access/approveUser'; -import { AuthorizationError } from '../../../../../server/utils/errors'; +import { AuthorizationError } from '../../../../../shared/utils/errors'; vi.mock('../../../../../server/database/queries/user'); diff --git a/test/server/middleware/user/access/decline.test.js b/test/server/middleware/user/access/decline.test.js index 3aef60d..8876cea 100644 --- a/test/server/middleware/user/access/decline.test.js +++ b/test/server/middleware/user/access/decline.test.js @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { createRequest, createResponse } from 'node-mocks-http'; import { declineAccess } from '../../../../../server/database/queries/user'; -import { AuthorizationError } from '../../../../../server/utils/errors'; +import { AuthorizationError } from '../../../../../shared/utils/errors'; import accessDeclineMiddleware from '../../../../../server/middleware/user/access/declineUser'; vi.mock('../../../../../server/database/queries/user'); diff --git a/test/server/middleware/user/access/removeUser.test.js b/test/server/middleware/user/access/removeUser.test.js index 2b9f7cb..0f9392a 100644 --- a/test/server/middleware/user/access/removeUser.test.js +++ b/test/server/middleware/user/access/removeUser.test.js @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { createRequest, createResponse } from 'node-mocks-http'; import { declineAccess } from '../../../../../server/database/queries/user'; -import { AuthorizationError } from '../../../../../server/utils/errors'; +import { AuthorizationError } from '../../../../../shared/utils/errors'; import accessRemoveMiddleware from '../../../../../server/middleware/user/access/removeUser'; vi.mock('../../../../../server/database/queries/user'); diff --git a/test/server/middleware/user/permission/update.test.js b/test/server/middleware/user/permission/update.test.js index 7420872..b6999e9 100644 --- a/test/server/middleware/user/permission/update.test.js +++ b/test/server/middleware/user/permission/update.test.js @@ -4,7 +4,7 @@ import { userExists, } from '../../../../../server/database/queries/user'; import permissionUpdateMiddleware from '../../../../../server/middleware/user/permission/update'; -import { AuthorizationError } from '../../../../../server/utils/errors'; +import { AuthorizationError } from '../../../../../shared/utils/errors'; vi.mock('../../../../../server/database/queries/user'); diff --git a/test/server/middleware/user/update/avatar.test.js b/test/server/middleware/user/update/avatar.test.js index cfa77bb..37f1910 100644 --- a/test/server/middleware/user/update/avatar.test.js +++ b/test/server/middleware/user/update/avatar.test.js @@ -4,10 +4,10 @@ import { userExists, } from '../../../../../server/database/queries/user'; import userUpdateAvatar from '../../../../../server/middleware/user/update/avatar'; -import validators from '../../../../../server/utils/validators'; +import validators from '../../../../../shared/validators'; vi.mock('../../../../../server/database/queries/user'); -vi.mock('../../../../../server/utils/validators'); +vi.mock('../../../../../shared/validators'); describe('userUpdateAvatar - Middleware', () => { const user = { diff --git a/test/server/middleware/user/update/password.test.js b/test/server/middleware/user/update/password.test.js index 85ca3c7..3cad730 100644 --- a/test/server/middleware/user/update/password.test.js +++ b/test/server/middleware/user/update/password.test.js @@ -4,10 +4,10 @@ import { userExists, } from '../../../../../server/database/queries/user'; import userUpdatePassword from '../../../../../server/middleware/user/update/password'; -import { verifyPassword } from '../../../../../server/utils/hashPassword'; +import { verifyPassword } from '../../../../../shared/utils/hashPassword'; vi.mock('../../../../../server/database/queries/user'); -vi.mock('../../../../../server/utils/hashPassword'); +vi.mock('../../../../../shared/utils/hashPassword'); describe('userUpdatePassword - Middleware', () => { const user = { diff --git a/test/server/middleware/user/update/username.test.js b/test/server/middleware/user/update/username.test.js index 3096ea4..32c50b7 100644 --- a/test/server/middleware/user/update/username.test.js +++ b/test/server/middleware/user/update/username.test.js @@ -4,10 +4,10 @@ import { userExists, } from '../../../../../server/database/queries/user'; import userUpdateUsername from '../../../../../server/middleware/user/update/username'; -import validators from '../../../../../server/utils/validators'; +import validators from '../../../../../shared/validators'; vi.mock('../../../../../server/database/queries/user'); -vi.mock('../../../../../server/utils/validators'); +vi.mock('../../../../../shared/validators'); describe('userUpdateUsername - Middleware', () => { const user = { diff --git a/test/shared/setupDatabase.js b/test/shared/setupDatabase.js index 29ea54e..72b07bb 100644 --- a/test/shared/setupDatabase.js +++ b/test/shared/setupDatabase.js @@ -3,8 +3,8 @@ import fs from 'fs'; // import local files import { SQLite } from '../../server/database/sqlite/setup.js'; -import { generateHash } from '../../server/utils/hashPassword.js'; -import logger from '../../server/utils/logger.js'; +import { generateHash } from '../../shared/utils/hashPassword.js'; +import logger from '../../shared/utils/logger.js'; import { loadJSON } from '../../shared/parseJson.js'; const loginDetails = loadJSON('../test/e2e/setup/fixtures/login.json');