mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
parent
ad7fb51cfa
commit
2ee1166747
1557 changed files with 76832 additions and 47042 deletions
|
@ -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',
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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';
|
Loading…
Add table
Add a link
Reference in a new issue