1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

feat: Version 2

Closes #627, closes #1047
This commit is contained in:
Maksim Eltyshev 2025-05-10 02:09:06 +02:00
parent ad7fb51cfa
commit 2ee1166747
1557 changed files with 76832 additions and 47042 deletions

View file

@ -2,9 +2,10 @@ const { expect } = require('chai');
describe('User (model)', () => {
before(async () => {
await User.create({
await User.qm.createOne({
email: 'test@test.test',
password: 'test',
role: User.Roles.ADMIN,
name: 'test',
});
});

View file

@ -1,5 +1,5 @@
const { expect } = require('chai');
const { getRemoteAddress } = require('../../utils/remoteAddress');
const { getRemoteAddress } = require('../../utils/remote-address');
/**
* Fake HTTP request object
@ -26,10 +26,10 @@ const mockRequest = (ip, ips) => {
* @param {boolean} trustProxy Whether the TRUST_PROXY environment variable was enabled.
*/
const mockProxyFlag = (trustProxy) => {
process.env.TRUST_PROXY = !!trustProxy;
process.env.TRUST_PROXY = trustProxy.toString();
};
describe('remoteAddress', () => {
describe('remote-address', () => {
describe('#getRemoteAddress(Request)', () => {
it('should get IPv4 remote address while not behind proxy and TRUST_PROXY=false', async () => {
const expectedAddress = '172.2.109.132';