mirror of
https://github.com/google/nomulus.git
synced 2025-05-19 10:49:35 +02:00
Wrap render of console.main soy in a utility function
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=216695490
This commit is contained in:
parent
9e02502fd4
commit
3bb525349f
9 changed files with 125 additions and 187 deletions
|
@ -16,22 +16,20 @@ goog.setTestOnly();
|
|||
|
||||
goog.require('goog.dispose');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.soy');
|
||||
goog.require('goog.testing.MockControl');
|
||||
goog.require('goog.testing.PropertyReplacer');
|
||||
goog.require('goog.testing.asserts');
|
||||
goog.require('goog.testing.jsunit');
|
||||
goog.require('goog.testing.net.XhrIo');
|
||||
goog.require('registry.registrar.ConsoleTestUtil');
|
||||
goog.require('registry.soy.registrar.console');
|
||||
goog.require('registry.testing');
|
||||
goog.require('registry.util');
|
||||
|
||||
|
||||
var $ = goog.dom.getRequiredElement;
|
||||
var stubs = new goog.testing.PropertyReplacer();
|
||||
const $ = goog.dom.getRequiredElement;
|
||||
const stubs = new goog.testing.PropertyReplacer();
|
||||
|
||||
var expectedRegistrar = {
|
||||
const expectedRegistrar = {
|
||||
ipAddressWhitelist: [],
|
||||
phonePasscode: '12345',
|
||||
clientCertificate: null,
|
||||
|
@ -39,7 +37,7 @@ var expectedRegistrar = {
|
|||
failoverClientCertificate: null
|
||||
};
|
||||
|
||||
var test = {
|
||||
const test = {
|
||||
testXsrfToken: '༼༎෴ ༎༽',
|
||||
testClientId: 'testClientId',
|
||||
mockControl: new goog.testing.MockControl()
|
||||
|
@ -49,19 +47,9 @@ var test = {
|
|||
function setUp() {
|
||||
registry.testing.addToDocument('<div id="test"/>');
|
||||
registry.testing.addToDocument('<div class="kd-butterbar"/>');
|
||||
goog.soy.renderElement($('test'), registry.soy.registrar.console.main, {
|
||||
username: 'jart',
|
||||
logoutUrl: 'https://example.com',
|
||||
isAdmin: true,
|
||||
registry.registrar.ConsoleTestUtil.renderConsoleMain($('test'), {
|
||||
xsrfToken: test.testXsrfToken,
|
||||
clientId: test.testClientId,
|
||||
logoFilename: 'logo.png',
|
||||
productName: 'Nomulus',
|
||||
integrationEmail: 'integration@example.com',
|
||||
supportEmail: 'support@example.com',
|
||||
announcementsEmail: 'announcement@example.com',
|
||||
supportPhoneNumber: '+1 (888) 555 0123',
|
||||
technicalDocsUrl: 'http://example.com/techdocs'
|
||||
});
|
||||
stubs.setPath('goog.net.XhrIo', goog.testing.net.XhrIo);
|
||||
registry.registrar.ConsoleTestUtil.setup(test);
|
||||
|
@ -101,14 +89,14 @@ function testEdit() {
|
|||
|
||||
registry.testing.click($('reg-app-btn-edit'));
|
||||
|
||||
var form = document.forms.namedItem('item');
|
||||
const form = document.forms.namedItem('item');
|
||||
form.elements['newIp'].value = '1.1.1.1';
|
||||
registry.testing.click($('btn-add-ip'));
|
||||
form.elements['newIp'].value = '2.2.2.2';
|
||||
registry.testing.click($('btn-add-ip'));
|
||||
|
||||
var exampleCert = $('exampleCert').value;
|
||||
var exampleCertHash = '6NKKNBnd2fKFooBINmn3V7L3JOTHh02+2lAqYHdlTgk';
|
||||
const exampleCert = $('exampleCert').value;
|
||||
const exampleCertHash = '6NKKNBnd2fKFooBINmn3V7L3JOTHh02+2lAqYHdlTgk';
|
||||
form.elements['clientCertificate'].value = exampleCert;
|
||||
form.elements['failoverClientCertificate'].value = 'bourgeois blues';
|
||||
registry.testing.click($('reg-app-btn-save'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue