Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit cd9a9fe

Browse files
committed
Add integration test for issue #582
1 parent abef455 commit cd9a9fe

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test-integration/client/issues.test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,36 @@ tap.test('whois works correctly (issue #370)', t => {
5656
})
5757
})
5858
})
59+
60+
tap.test('can access large groups (issue #582)', t => {
61+
const client = ldapjs.createClient({ url: baseURL })
62+
client.bind('cn=admin,dc=planetexpress,dc=com ', 'GoodNewsEveryone', (err) => {
63+
t.error(err)
64+
const searchOpts = {
65+
scope: 'sub',
66+
filter: '(&(objectClass=group)(cn=large_group))'
67+
}
68+
client.search('ou=large_ou,dc=planetexpress,dc=com', searchOpts, (err, response) => {
69+
t.error(err)
70+
71+
const results = []
72+
response.on('searchEntry', (entry) => {
73+
results.push(entry)
74+
})
75+
response.on('error', t.error)
76+
response.on('end', (result) => {
77+
t.is(result.status, 0)
78+
t.is(results.length === 1, true)
79+
t.ok(results[0].attributes)
80+
81+
const memberAttr = results[0].attributes.find(a => a.type === 'member')
82+
t.ok(memberAttr)
83+
t.ok(memberAttr.vals)
84+
t.type(memberAttr.vals, Array)
85+
t.is(memberAttr.vals.length, 2000)
86+
87+
client.unbind(t.end)
88+
})
89+
})
90+
})
91+
})

0 commit comments

Comments
 (0)