mirror of
https://github.com/google/nomulus.git
synced 2025-05-31 17:54:08 +02:00
Respond to CR
This commit is contained in:
parent
5927ea9fd9
commit
55a82425e7
8 changed files with 18 additions and 22 deletions
1
core/.gitignore
vendored
1
core/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
out/
|
|
@ -24,7 +24,7 @@ goog.require('registry.registrar.ConsoleTestUtil');
|
|||
goog.require('registry.testing');
|
||||
goog.require('registry.util');
|
||||
|
||||
describe("console tests", function() {
|
||||
describe("console test", function() {
|
||||
const $ = goog.dom.getRequiredElement;
|
||||
const stubs = new goog.testing.PropertyReplacer();
|
||||
|
||||
|
@ -81,9 +81,8 @@ describe("console tests", function() {
|
|||
});
|
||||
const xhr = goog.testing.net.XhrIo.getSendInstances().pop();
|
||||
expect(xhr.isActive()).toBe(true);
|
||||
expect('/registrar-settings').toEqual(xhr.getLastUri());
|
||||
expect(test.testXsrfToken).toEqual(
|
||||
xhr.getLastRequestHeaders()['X-CSRF-Token']);
|
||||
expect(xhr.getLastUri()).toEqual('/registrar-settings');
|
||||
expect(xhr.getLastRequestHeaders()['X-CSRF-Token']).toEqual(test.testXsrfToken);
|
||||
xhr.simulateResponse(200, goog.json.serialize({
|
||||
status: 'SUCCESS',
|
||||
message: 'OK',
|
||||
|
@ -106,9 +105,8 @@ describe("console tests", function() {
|
|||
});
|
||||
const xhr = goog.testing.net.XhrIo.getSendInstances().pop();
|
||||
expect(xhr.isActive()).toBe(true);
|
||||
expect('/registrar-settings').toEqual(xhr.getLastUri());
|
||||
expect(test.testXsrfToken).toEqual(
|
||||
xhr.getLastRequestHeaders()['X-CSRF-Token']);
|
||||
expect(xhr.getLastUri()).toEqual('/registrar-settings');
|
||||
expect(xhr.getLastRequestHeaders()['X-CSRF-Token']).toEqual(test.testXsrfToken);
|
||||
const passcode = '5-5-5-5-5';
|
||||
xhr.simulateResponse(200, goog.json.serialize({
|
||||
status: 'SUCCESS',
|
||||
|
@ -117,7 +115,6 @@ describe("console tests", function() {
|
|||
phonePasscode: passcode
|
||||
}]
|
||||
}));
|
||||
expect(passcode).toEqual(
|
||||
goog.dom.getTextContent($('domain-registrar-phone-passcode')));
|
||||
expect(goog.dom.getTextContent($('domain-registrar-phone-passcode'))).toEqual(passcode);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -74,18 +74,18 @@ describe("contact settings test", function() {
|
|||
}]
|
||||
}
|
||||
);
|
||||
expect(1).toEqual($('admin-contacts').childNodes.length);
|
||||
expect(1).toEqual($('other-contacts').childNodes.length);
|
||||
expect($('admin-contacts').childNodes.length).toEqual(1);
|
||||
expect($('other-contacts').childNodes.length).toEqual(1);
|
||||
// XXX: Needs more field testing.
|
||||
});
|
||||
|
||||
|
||||
it("testItemView", function() {
|
||||
testItemView();
|
||||
expect(testContact.name).toEqual($('contacts[0].name').value);
|
||||
expect(testContact.emailAddress).toEqual($('contacts[0].emailAddress').value);
|
||||
expect(testContact.phoneNumber).toEqual($('contacts[0].phoneNumber').value);
|
||||
expect(testContact.faxNumber).toEqual($('contacts[0].faxNumber').value);
|
||||
expect($('contacts[0].name').value).toEqual(testContact.name);
|
||||
expect($('contacts[0].emailAddress').value).toEqual(testContact.emailAddress);
|
||||
expect($('contacts[0].phoneNumber').value).toEqual(testContact.phoneNumber);
|
||||
expect($('contacts[0].faxNumber').value).toEqual(testContact.faxNumber);
|
||||
// XXX: Types are no longer broken out as individual settings, so relying on
|
||||
// screenshot test.
|
||||
});
|
||||
|
@ -361,5 +361,4 @@ describe("contact settings test", function() {
|
|||
delete contact['type'];
|
||||
return contact;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -74,7 +74,7 @@ describe('security settings test', function() {
|
|||
message: 'OK',
|
||||
results: [expectedRegistrar]
|
||||
});
|
||||
expect(expectedRegistrar.phonePasscode).toEqual(registry.util.parseForm('item').phonePasscode);
|
||||
expect(registry.util.parseForm('item').phonePasscode).toEqual(expectedRegistrar.phonePasscode);
|
||||
}
|
||||
|
||||
it("testView", function() {
|
||||
|
|
|
@ -142,7 +142,7 @@ describe("whois settings test", function() {
|
|||
const msgBox = goog.dom.getNextElementSibling($('phoneNumber'));
|
||||
expect(goog.dom.classlist.contains(msgBox, 'kd-errormessage')).toBe(true);
|
||||
expect(goog.dom.classlist.contains($('phoneNumber'), 'kd-formerror')).toBe(true);
|
||||
expect(errMsg).toEqual(goog.dom.getTextContent(msgBox));
|
||||
expect(goog.dom.getTextContent(msgBox)).toEqual(errMsg);
|
||||
});
|
||||
|
||||
it("testEditNonFieldError_showsButterBar", function() {
|
||||
|
@ -161,6 +161,6 @@ describe("whois settings test", function() {
|
|||
status: 'ERROR',
|
||||
message: errMsg
|
||||
});
|
||||
expect(errMsg).toEqual(goog.dom.getTextContent($$('kd-butterbar-text')));
|
||||
expect(goog.dom.getTextContent($$('kd-butterbar-text'))).toEqual(errMsg);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue