Skip to content

test(test-suite): restore dpns tests #1725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 15 additions & 54 deletions packages/platform-test-suite/test/e2e/dpns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ describe('DPNS', () => {
expect(createdTLD.getData().normalizedParentDomainName).to.equal('');
});

// TODO(rs-drive-abci): restore
// There are two DataTriggerAction errors now. One is used in rs-drive-abci data trigger (new)
// And other is in dpp data trigger (old). New error is dispatched in this test,
// but it does not have binding yet.
// Decide what to do with rs-dpp data trigger and it's errors,
// and update bindings and test accordingly
it.skip('should not be able to update domain', async () => {
it('should not be able to update domain', async () => {
createdTLD.set('label', 'anotherlabel');

let broadcastError;
Expand All @@ -116,13 +110,7 @@ describe('DPNS', () => {
expect(broadcastError.code).to.equal(4001);
});

// TODO(rs-drive-abci): restore
// There are two DataTriggerAction errors now. One is used in rs-drive-abci data trigger (new)
// And other is in dpp data trigger (old). New error is dispatched in this test,
// but it does not have binding yet.
// Decide what to do with rs-dpp data trigger and it's errors,
// and update bindings and test accordingly
it.skip('should not be able to delete domain', async () => {
it('should not be able to delete domain', async () => {
let broadcastError;

try {
Expand Down Expand Up @@ -152,11 +140,7 @@ describe('DPNS', () => {
}
});

// TODO(rs-drive-abci): test randomly returns StateTransition already in chain error,
// but it's happening because of retry attempts for the same ST.
// Underlying issue causing retry is different and should be debugged.
// (console.log error in dapi-client's GrpcTransport for more details)
it.skip('should not be able to register TLD', async () => {
it('should not be able to register TLD', async () => {
let broadcastError;

try {
Expand All @@ -172,11 +156,7 @@ describe('DPNS', () => {
expect(broadcastError.code).to.equal(4001);
});

// TODO(rs-drive-abci): test randomly returns StateTransition already in chain error,
// but it's happening because of retry attempts for the same ST.
// Underlying issue causing retry is different and should be debugged.
// (console.log error in dapi-client's GrpcTransport for more details)
it.skip('should be able to register a second level domain', async () => {
it('should be able to register a second level domain', async () => {
registeredDomain = await client.platform.names.register(`${secondLevelDomain}0.${topLevelDomain}`, {
dashUniqueIdentityId: identity.getId(),
}, identity);
Expand All @@ -185,11 +165,11 @@ describe('DPNS', () => {
await waitForSTPropagated();

expect(registeredDomain.getType()).to.equal('domain');
expect(registeredDomain.getData().label).to.equal(secondLevelDomain);
expect(registeredDomain.getData().label).to.equal(`${secondLevelDomain}0`);
expect(registeredDomain.getData().normalizedParentDomainName).to.equal(topLevelDomain);
});

it.skip('should not be able register similar domain name', async () => {
it('should not be able register similar domain name', async () => {
let broadcastError;

try {
Expand All @@ -206,18 +186,14 @@ describe('DPNS', () => {

expect(broadcastError).to.exist();
expect(broadcastError.code).to.be.equal(4009);
expect(broadcastError.message).to.match(/Document \w* has duplicate unique properties \["normalizedLabel", "normalizedParentDomainName"] with other documents/);
expect(broadcastError.message).to.match(/Document \w* has duplicate unique properties \["normalizedParentDomainName", "normalizedLabel"] with other documents/);
});

// TODO(rs-drive-abci): test randomly returns StateTransition already in chain error,
// but it's happening because of retry attempts for the same ST.
// Underlying issue causing retry is different and should be debugged.
// (console.log error in dapi-client's GrpcTransport for more details)
it.skip('should not be able to register a subdomain for parent domain which is not exist', async () => {
it('should not be able to register a subdomain for parent domain which is not exist', async () => {
let broadcastError;

try {
const domain = `${getRandomDomain()}.${getRandomDomain()}.${topLevelDomain}`;
const domain = `${getRandomDomain()}.${getRandomDomain()}`;

await client.platform.names.register(domain, {
dashAliasIdentityId: identity.getId(),
Expand All @@ -233,8 +209,7 @@ describe('DPNS', () => {
expect(broadcastError.code).to.equal(4001);
});

// TODO(rs-drive-abci): restore - toObject mismatch (happens randomly)
it.skip('should be able to search a domain', async () => {
it('should be able to search a domain', async () => {
const documents = await client.platform.names.search(secondLevelDomain, topLevelDomain);

expect(documents).to.have.lengthOf(1);
Expand All @@ -244,15 +219,13 @@ describe('DPNS', () => {
expect(document.toObject()).to.deep.equal(registeredDomain.toObject());
});

// TODO(rs-drive-abci): restore - toObject mismatch (happens randomly)
it.skip('should be able to resolve domain by it\'s name', async () => {
const document = await client.platform.names.resolve(`${secondLevelDomain}.${topLevelDomain}`);
it('should be able to resolve domain by it\'s name', async () => {
const document = await client.platform.names.resolve(`${secondLevelDomain}0.${topLevelDomain}`);

expect(document.toObject()).to.deep.equal(registeredDomain.toObject());
});

// TODO(rs-drive-abci): restore - toObject mismatch (happens randomly)
it.skip('should be able to resolve domain by it\'s record', async () => {
it('should be able to resolve domain by it\'s record', async () => {
const [document] = await client.platform.names.resolveByRecord(
'dashUniqueIdentityId',
registeredDomain.getData().records.dashUniqueIdentityId,
Expand All @@ -261,13 +234,7 @@ describe('DPNS', () => {
expect(document.toObject()).to.deep.equal(registeredDomain.toObject());
});

// TODO(rs-drive-abci): restore
// There are two DataTriggerAction errors now. One is used in rs-drive-abci data trigger (new)
// And other is in dpp data trigger (old). New error is dispatched in this test,
// but it does not have binding yet.
// Decide what to do with rs-dpp data trigger and it's errors,
// and update bindings and test accordingly
it.skip('should not be able to update domain', async () => {
it('should not be able to update domain', async () => {
registeredDomain.set('label', 'newlabel');

let broadcastError;
Expand All @@ -287,13 +254,7 @@ describe('DPNS', () => {
expect(broadcastError.code).to.equal(4001);
});

// TODO(rs-drive-abci): restore
// There are two DataTriggerAction errors now. One is used in rs-drive-abci data trigger (new)
// And other is in dpp data trigger (old). New error is dispatched in this test,
// but it does not have binding yet.
// Decide what to do with rs-dpp data trigger and it's errors,
// and update bindings and test accordingly
it.skip('should not be able to delete domain', async () => {
it('should not be able to delete domain', async () => {
let broadcastError;

try {
Expand Down