Skip to content

Commit 213fcb8

Browse files
authored
fix(addressregister-tests): add more addressregister tests ZMS-245 (#834)
1 parent 5631bd4 commit 213fcb8

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

test/api-test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,41 @@ describe('API tests', function () {
677677

678678
it('should GET /users/:user/addressregister expect success', async () => {
679679
const response = await server.get(`/users/${userId}/addressregister?query=best`);
680+
681+
expect(response.body.results[0].name).to.equal('test töster');
682+
});
683+
684+
it('should GET /users/:user/addressregister expect failure', async () => {
685+
const response = await server.get(`/users/${userId}/addressregister?query=wrongname`);
686+
687+
expect(response.body.results.length).to.equal(0);
688+
expect(response.body.results).to.be.empty;
689+
});
690+
691+
it('should GET /users/:user/addressregister expect success / search domain without tld', async () => {
692+
const response = await server.get(`/users/${userId}/addressregister?query=öxample`);
693+
680694
expect(response.body.results[0].name).to.equal('test töster');
681695
});
696+
697+
it('should GET /users/:user/addressregister expect success / search domain with tld', async () => {
698+
const response = await server.get(`/users/${userId}/addressregister?query=öxample.com`);
699+
700+
expect(response.body.results[0].name).to.equal('test töster');
701+
});
702+
703+
it('should GET /users/:user/addressregister expect success / search domain partial', async () => {
704+
const response = await server.get(`/users/${userId}/addressregister?query=öx`);
705+
706+
expect(response.body.results[0].name).to.equal('test töster');
707+
});
708+
709+
it('should GET /users/:user/addressregister expect failure / search domain', async () => {
710+
const response = await server.get(`/users/${userId}/addressregister?query=mydomain.tld`);
711+
712+
expect(response.body.results.length).to.equal(0);
713+
expect(response.body.results).to.be.empty;
714+
});
682715
});
683716

684717
describe('certs', () => {

0 commit comments

Comments
 (0)