Skip to content

Commit

Permalink
Remove unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
julio-cfa committed Sep 12, 2024
1 parent 67d5654 commit 7ede032
Showing 1 changed file with 0 additions and 104 deletions.
104 changes: 0 additions & 104 deletions apps/meteor/tests/end-to-end/api/24-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -3441,110 +3441,6 @@ describe('Meteor.methods', function () {
});
});

(IS_EE ? describe : describe.skip)('[@auditGetAuditions] EE', () => {
let testUser;
let testUserCredentials;

const now = new Date();
const startDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0).getTime();
const endDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999).getTime();

before('create test user', async () => {
testUser = await createUser();
testUserCredentials = await login(testUser.username, password);
});

before('generate audits data', async () => {
await request
.post(methodCall('auditGetMessages'))
.set(credentials)
.send({
message: JSON.stringify({
method: 'auditGetMessages',
params: [
{
type: '',
msg: 'test1234',
startDate: { $date: startDate },
endDate: { $date: endDate },
rid: 'GENERAL',
users: [],
},
],
id: '14',
msg: 'method',
}),
});
});

after(() => Promise.all([deleteUser(testUser)]));

it('should fail if the user does not have permissions to get auditions', async () => {
await request
.post(methodCall('auditGetAuditions'))
.set(testUserCredentials)
.send({
message: JSON.stringify({
method: 'auditGetAuditions',
params: [
{
startDate: { $date: startDate },
endDate: { $date: endDate },
},
],
id: '18',
msg: 'method',
}),
})
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.a.property('message');
const data = JSON.parse(res.body.message);
expect(data).to.have.a.property('error');
expect(data.error).to.have.a.property('error', 'Not allowed');
});
});

it('should not return more user data than necessary - e.g. passwords, hashes, tokens', async () => {
await request
.post(methodCall('auditGetAuditions'))
.set(credentials)
.send({
message: JSON.stringify({
method: 'auditGetAuditions',
params: [
{
startDate: { $date: startDate },
endDate: { $date: endDate },
},
],
id: '18',
msg: 'method',
}),
})
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.a.property('success', true);
expect(res.body).to.have.a.property('message').that.is.a('string');
const data = JSON.parse(res.body.message);
expect(data).to.have.a.property('result').that.is.an('array');
expect(data.result.length).to.be.greaterThan(0);
expect(data).to.have.a.property('msg', 'result');
expect(data).to.have.a.property('id', '18');
data.result.forEach((item) => {
expect(item).to.have.all.keys('_id', 'ts', 'results', 'u', 'fields', '_updatedAt');
expect(item.u).to.not.have.property('services');
expect(item.u).to.not.have.property('roles');
expect(item.u).to.not.have.property('lastLogin');
expect(item.u).to.not.have.property('statusConnection');
expect(item.u).to.not.have.property('emails');
});
});
});
});

describe('UpdateOTRAck', () => {
let testUser;
let testUser2;
Expand Down

0 comments on commit 7ede032

Please sign in to comment.