<commit_before>// test/stubbatti.js

/* global describe, it, afterEach, beforeEach */

'use strict';

var http = require('http');
var concat = require('concat-stream');
var expect = require('chai').expect;

var Stubbatti = require('./');

var DEFAULT_HOST = 'http://0.0.0.0:28987';

// test utility for get request the server
var get = function (path, cb) {

    http.get(DEFAULT_HOST + path, function (res) {

        res.pipe(concat({encoding: 'string'}, function (data) {
            cb(data, res.headers, res.statusCode);
        }));

    });

};

describe('Stubbatti', function () {

    var stubbatti;

    beforeEach(function () {

        stubbatti = new Stubbatti();
        stubbatti.setConsole({log: function () {}});

    });

    afterEach(function (done) {

        stubbatti.stop(function () {

            done();

        });

    });

    describe('register', function () {

        it('registers a response for a path', function (done) {

            stubbatti.register('get', '/hello', 'Hello, world!');

            stubbatti.start(function () {

                get('/hello', function (data, headers, status) {

                    expect(data).to.equal('Hello, world!');
                    expect(status).to.equal(200);

                    done();

                });

            });
        });

        it('registers a delayed response for a path if delay option is specified', function (done) {

            stubbatti.register('get', '/delay', 'delayed response', {delay: 1000});

            var startTime = new Date().getTime();

            stubbatti.start(function () {

                get('/delay', function (data) {

                    expect(data).to.equal('delayed response');

                    var endTime = new Date().getTime();

                    var error = Math.abs(startTime + 1000 - endTime);

                    expect(error).to.be.below(100);

                    done();

                });

            });

        });

        it('registers a response with custom Content-Type if contentType option is set', function (done) {

            stubbatti.register('get', '/json', '{}', {contentType: 'application/json'});

            stubbatti.start(function () {

                get('/json', function (data, headers) {

                    expect(headers['content-type']).to.match(/^application\/json;/);

                    done();

                });

            });

        });

        it('registers a response with a custom status code if status option is set', function (done) {

            stubbatti.register('get', '/402', 'payment required', {status: 402});

            stubbatti.start(function () {

                get('/402', function (data, headers, status) {

                    expect(status).to.equal(402);

                    done();

                });

            });

        });

    });

});
<commit_msg>Add the test of custom headers<commit_after>// test/stubbatti.js

/* global describe, it, afterEach, beforeEach */

'use strict';

var http = require('http');
var concat = require('concat-stream');
var expect = require('chai').expect;

var Stubbatti = require('./');

var DEFAULT_HOST = 'http://0.0.0.0:28987';

// test utility for get request the server
var get = function (path, cb) {

    http.get(DEFAULT_HOST + path, function (res) {

        res.pipe(concat({encoding: 'string'}, function (data) {
            cb(data, res.headers, res.statusCode);
        }));

    });

};

describe('Stubbatti', function () {

    var stubbatti;

    beforeEach(function () {

        stubbatti = new Stubbatti();
        stubbatti.setConsole({log: function () {}});

    });

    afterEach(function (done) {

        stubbatti.stop(function () {

            done();

        });

    });

    describe('register', function () {

        it('registers a response for a path', function (done) {

            stubbatti.register('get', '/hello', 'Hello, world!');

            stubbatti.start(function () {

                get('/hello', function (data, headers, status) {

                    expect(data).to.equal('Hello, world!');
                    expect(status).to.equal(200);

                    done();

                });

            });
        });

        it('registers a delayed response for a path if delay option is specified', function (done) {

            stubbatti.register('get', '/delay', 'delayed response', {delay: 1000});

            var startTime = new Date().getTime();

            stubbatti.start(function () {

                get('/delay', function (data) {

                    expect(data).to.equal('delayed response');

                    var endTime = new Date().getTime();

                    var error = Math.abs(startTime + 1000 - endTime);

                    expect(error).to.be.below(100);

                    done();

                });

            });

        });

        it('registers a response with custom Content-Type if contentType option is set', function (done) {

            stubbatti.register('get', '/json', '{}', {contentType: 'application/json'});

            stubbatti.start(function () {

                get('/json', function (data, headers) {

                    expect(headers['content-type']).to.match(/^application\/json;/);

                    done();

                });

            });

        });

        it('registers a response with a custom status code if status option is set', function (done) {

            stubbatti.register('get', '/402', 'payment required', {status: 402});

            stubbatti.start(function () {

                get('/402', function (data, headers, status) {

                    expect(status).to.equal(402);

                    done();

                });

            });

        });

        it('registers a response with custom headers if `headers` options are set', function (done) {

            stubbatti.register('get', '/custom', 'custom', {headers: {
                'X-Custom': 'abc',
                'X-Header': 'def'
            }});

            stubbatti.start(function () {

                get('/custom', function (data, headers) {

                    expect(headers['x-custom']).to.equal('abc');
                    expect(headers['x-header']).to.equal('def');

                    done();

                });

            });

        });

    });

});
<|endoftext|>


<commit_before>'use strict'

function SettingsWorld() {
    this.__init__()
}

// Cell phone carriers.
const CELL_PHONE_CARRIERS = {
    'None'             : '',
    'AT&T'             : 'number@txt.att.net',
    'T-Mobile'         : 'number@tmomail.net',
    'Verizon'          : 'number@vtext.com',
    'Sprint'           : 'number@pm.sprint.com',
    'Virgin Mobile'    : 'number@vmobl.com',
    'Tracfone'         : 'number@mmst5.tracfone.com',
    'Metro PCS'        : 'number@mymetropcs.com',
    'Boost Mobile'     : 'number@myboostmobile.com',
    'Cricket'          : 'number@mms.cricketwireless.net',
    'Ptel'             : 'number@ptel.com',
    'Republic Wireless': 'number@text.republicwireless.com',
    'Google Fi'        : 'number@msg.fi.google.com',
    'Suncom'           : 'number@tms.suncom.com',
    'Ting'             : 'number@message.ting.com',
    'U.S. Cellular'    : 'number@email.uscc.net',
    'Consumer Cellular': 'number@cingularme.com',
    'C-Spire'          : 'number@cspire1.com',
    'Page Plus'        : 'number@vtext.com'
}

SettingsWorld.prototype = {

    previous_world: null,

    owner_entity: null,

    select_phone_carrier: function() {
        this.phone_carrier_list.set_to_visible()
    },

    __init__: function() {
        this.owner_entity = null

        // Inherit world properties.
        World.call(this, 'SettingsWorld')

        var position = new THREE.Vector3(500, 500, 700)
        this.normal = new THREE.Vector3(-.5, 0, -.85)
        this.normal.normalize()
        this.profile_editor = new FloatingWall(1024, 512 / 2, position, this.normal, this)

        var create_entity_wall_title = this.profile_editor.add_floating_2d_text(1024 / 2, 'Profile Information', TYPE_TITLE, 1024 / -4, 2, 0, 0)
        create_entity_wall_title.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_editor.add_object_to_remove_later(create_entity_wall_title)

        var label_width = 1024 / 8
        var label_offset = (1024 / -4) - label_width / 2

        this.profile_name_label = this.profile_editor.add_floating_2d_text(label_width, 'Username', TYPE_INPUT_REGULAR, label_offset, 2, 3, 0)
        this.profile_name_label.engable = false
        this.profile_name_label.set_default_color(COLOR_TEXT_CONSTANT)
        //this.profile_editor.add_object_to_remove_later(profile_name)

        this.profile_name_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 3, 0)
        //this.profile_editor.add_object_to_remove_later(profile_name_input)

        this.profile_email_label = this.profile_editor.add_floating_2d_text(label_width, 'Email', TYPE_INPUT_REGULAR, label_offset, 2, 4, 0)
        this.profile_email_label.engable = false
        this.profile_email_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_email_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 4, 0)

        this.profile_phone_number_label = this.profile_editor.add_floating_2d_text(label_width, 'Phone Number', TYPE_INPUT_REGULAR, label_offset, 2, 5, 0)
        this.profile_phone_number_label.engable = false
        this.profile_phone_number_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_phone_number_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 5, 0)

        this.profile_phone_carrier_label = this.profile_editor.add_floating_2d_text(label_width, 'Phone Carrier', TYPE_INPUT_REGULAR, label_offset, 2, 6, 0)
        this.profile_phone_carrier_label.engable = false
        this.profile_phone_carrier_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_phone_carrier_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 6, 0)
        this.profile_phone_carrier_input.engable = false
        // TODO :
        this.profile_phone_carrier_input.set_engage_function(this.select_phone_carrier.bind(this))

        //////
        this.phone_carrier_list = new FloatingWall(512 / 2, 512, this.profile_phone_carrier_input.get_position(), this.normal, this)
        var phone_carrier_title = this.phone_carrier_list.add_floating_2d_text(512 / 2, 'Select Phone Carrier', TYPE_TITLE, 0, 4, 0, 0)
        this.phone_carrier_list.add_floating_2d_text(512 / 2, 'AT&T', TYPE_TITLE, 0, 4, 1, 0)
        this.phone_carrier_list.set_to_invisible()
        //////

        this.save_changes = this.profile_editor.add_floating_2d_text(1024, 'Save Changes', TYPE_BUTTON, 0, 2, 8, 0)

        this.interactive_objects.push(this.profile_name_label)
        this.interactive_objects.push(this.profile_name_input)
        this.interactive_objects.push(this.profile_email_label)
        this.interactive_objects.push(this.profile_email_input)
        this.interactive_objects.push(this.profile_phone_number_label)
        this.interactive_objects.push(this.profile_phone_number_input)
        this.interactive_objects.push(this.profile_phone_carrier_label)
        this.interactive_objects.push(this.profile_phone_carrier_input)
        this.interactive_objects.push(this.save_changes)
    },

    update: function() {
        this.update_interactive_objects()
    },

    key_down_event: function(event) {
        this.key_down_event_for_interactive_objects(event)
    },

    enter_world: function() {
        this.player.disengage()
        if (!PAUSED_MENU.currently_displayed) {
            this.player.enable_controls()
        }

        this.player.set_position(new THREE.Vector3(-1000, 350, 350))
        this.player.look_at(new THREE.Vector3(0.992, 0.124, -0.122))

        this.previous_world = WORLD_MANAGER.previous_world

        // Set the profile information values.

        // TODO : Grab the values from the owner entity!
        if (this.owner_entity === null) {
            this.owner_entity = ENTITY_MANAGER.get_all_entities_of_type(ENTITY_TYPE_OWNER)[0]
        }

        this.profile_name_input.update_text(this.player.owner.username)
        this.profile_email_input.update_text(this.owner_entity.get_value('owner_email'))
        this.profile_phone_number_input.update_text(this.owner_entity.get_value('owner_phone_number'))
        this.profile_phone_carrier_input.update_text(this.owner_entity.get_value('owner_phone_carrier'))
    },

    exit_world: function() {
    }
}
<commit_msg>general updating 63<commit_after>'use strict'

function SettingsWorld() {
    this.__init__()
}

// Cell phone carriers.
const CELL_PHONE_CARRIERS = {
    'None'             : '',
    'AT&T'             : 'number@txt.att.net',
    'T-Mobile'         : 'number@tmomail.net',
    'Verizon'          : 'number@vtext.com',
    'Sprint'           : 'number@pm.sprint.com',
    'Virgin Mobile'    : 'number@vmobl.com',
    'Tracfone'         : 'number@mmst5.tracfone.com',
    'Metro PCS'        : 'number@mymetropcs.com',
    'Boost Mobile'     : 'number@myboostmobile.com',
    'Cricket'          : 'number@mms.cricketwireless.net',
    'Ptel'             : 'number@ptel.com',
    'Republic Wireless': 'number@text.republicwireless.com',
    'Google Fi'        : 'number@msg.fi.google.com',
    'Suncom'           : 'number@tms.suncom.com',
    'Ting'             : 'number@message.ting.com',
    'U.S. Cellular'    : 'number@email.uscc.net',
    'Consumer Cellular': 'number@cingularme.com',
    'C-Spire'          : 'number@cspire1.com',
    'Page Plus'        : 'number@vtext.com'
}

SettingsWorld.prototype = {

    previous_world: null,

    owner_entity: null,

    select_phone_carrier: function() {
        this.phone_carrier_list.set_to_visible()
    },

    __init__: function() {
        this.owner_entity = null

        // Inherit world properties.
        World.call(this, 'SettingsWorld')

        var position = new THREE.Vector3(500, 500, 700)
        this.normal = new THREE.Vector3(-.5, 0, -.85)
        this.normal.normalize()
        this.profile_editor = new FloatingWall(1024, 512 / 2, position, this.normal, this)

        var create_entity_wall_title = this.profile_editor.add_floating_2d_text(1024 / 2, 'Profile Information', TYPE_TITLE, 1024 / -4, 2, 0, 0)
        create_entity_wall_title.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_editor.add_object_to_remove_later(create_entity_wall_title)

        var label_width = 1024 / 8
        var label_offset = (1024 / -4) - label_width / 2

        this.profile_name_label = this.profile_editor.add_floating_2d_text(label_width, 'Username', TYPE_INPUT_REGULAR, label_offset, 2, 3, 0)
        this.profile_name_label.engable = false
        this.profile_name_label.set_default_color(COLOR_TEXT_CONSTANT)
        //this.profile_editor.add_object_to_remove_later(profile_name)

        this.profile_name_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 3, 0)
        //this.profile_editor.add_object_to_remove_later(profile_name_input)

        this.profile_email_label = this.profile_editor.add_floating_2d_text(label_width, 'Email', TYPE_INPUT_REGULAR, label_offset, 2, 4, 0)
        this.profile_email_label.engable = false
        this.profile_email_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_email_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 4, 0)

        this.profile_phone_number_label = this.profile_editor.add_floating_2d_text(label_width, 'Phone Number', TYPE_INPUT_REGULAR, label_offset, 2, 5, 0)
        this.profile_phone_number_label.engable = false
        this.profile_phone_number_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_phone_number_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 5, 0)

        this.profile_phone_carrier_label = this.profile_editor.add_floating_2d_text(label_width, 'Phone Carrier', TYPE_INPUT_REGULAR, label_offset, 2, 6, 0)
        this.profile_phone_carrier_label.engable = false
        this.profile_phone_carrier_label.set_default_color(COLOR_TEXT_CONSTANT)
        this.profile_phone_carrier_input = this.profile_editor.add_floating_2d_text(1024 / 2, '', TYPE_INPUT_REGULAR, 1024 / -4 + (1024 / 4) + 50, 2, 6, 0)
        this.profile_phone_carrier_input.engable = false
        // TODO :
        this.profile_phone_carrier_input.set_engage_function(this.select_phone_carrier.bind(this))

        //////
        this.phone_carrier_list = new FloatingWall(512 / 2, 512, this.profile_phone_carrier_input.get_position().addScaledVector(this.normal, 2), this.normal, this)
        var phone_carrier_title = this.phone_carrier_list.add_floating_2d_text(512 / 2, 'Select Phone Carrier', TYPE_TITLE, 0, 4, 0, 0)
        this.phone_carrier_list.add_floating_2d_text(512 / 2, 'AT&T', TYPE_TITLE, 0, 4, 1, 0)
        this.phone_carrier_list.set_to_invisible()
        //////

        this.save_changes = this.profile_editor.add_floating_2d_text(1024, 'Save Changes', TYPE_BUTTON, 0, 2, 8, 0)

        this.interactive_objects.push(this.profile_name_label)
        this.interactive_objects.push(this.profile_name_input)
        this.interactive_objects.push(this.profile_email_label)
        this.interactive_objects.push(this.profile_email_input)
        this.interactive_objects.push(this.profile_phone_number_label)
        this.interactive_objects.push(this.profile_phone_number_input)
        this.interactive_objects.push(this.profile_phone_carrier_label)
        this.interactive_objects.push(this.profile_phone_carrier_input)
        this.interactive_objects.push(this.save_changes)
    },

    update: function() {
        this.update_interactive_objects()
    },

    key_down_event: function(event) {
        this.key_down_event_for_interactive_objects(event)
    },

    enter_world: function() {
        this.player.disengage()
        if (!PAUSED_MENU.currently_displayed) {
            this.player.enable_controls()
        }

        this.player.set_position(new THREE.Vector3(-1000, 350, 350))
        this.player.look_at(new THREE.Vector3(0.992, 0.124, -0.122))

        this.previous_world = WORLD_MANAGER.previous_world

        // Set the profile information values.

        // TODO : Grab the values from the owner entity!
        if (this.owner_entity === null) {
            this.owner_entity = ENTITY_MANAGER.get_all_entities_of_type(ENTITY_TYPE_OWNER)[0]
        }

        this.profile_name_input.update_text(this.player.owner.username)
        this.profile_email_input.update_text(this.owner_entity.get_value('owner_email'))
        this.profile_phone_number_input.update_text(this.owner_entity.get_value('owner_phone_number'))
        this.profile_phone_carrier_input.update_text(this.owner_entity.get_value('owner_phone_carrier'))
    },

    exit_world: function() {
    }
}
<|endoftext|>


<commit_before>'use strict';

exports['sub-main'] = function () {
	section(
		{ class: 'submitted-main' },
		table(
			{ class: 'submitted-user-data-table table-responsive' },
			thead(
				tr(
					th("Status"),
					th("Application number"),
					th("Application date"),
					th("Requested registrations"),
					th("")
				)
			),
			tbody(
				tr(
					td(
						div({ class: 'cell-caption' },
							"Status"),
						div({ class: 'cell-body' },
							"Pending for revision")
					),
					td(
						div({ class: 'cell-caption' },
							"Application number"),
						div({ class: 'cell-body' },
							"4068-50001-N-2013")
					),
					td(
						div({ class: 'cell-caption' },
							"Application date"),
						div({ class: 'cell-body' },
							"23/07/2014 18:09:22")
					),
					td(
						div({ class: 'cell-caption' },
							"Requested registrations"),
						div({ class: 'cell-body' },
							span({ class: 'label-reg' }, "Brela"),
							span({ class: 'label-reg' }, "Tinc"),
							span({ class: 'label-reg' }, "Vat"),
							span({ class: 'label-reg' }, "Gepf"),
							span({ class: 'label-reg' }, "Nssf"),
							span({ class: 'label-reg' }, "Lapf")
							)
					),
					td(
						div({ class: 'cell-caption' },
							""),
						div({ class: 'cell-body' },
							a({ class: 'fa fa-download' }, "Print")
							)
					)
				)
			)
		)
	);
	section(
		{ class: 'section-primary' },
		div(
			h2({ class: 'nav-alternatives' }, "Application history",
				a({ class: 'fa fa-print' }, "Print")
				),
			table(
				{ class: 'submitted-user-history' },
				tbody(
					tr(
						th(
							div("User")
						),
						td(
							div("John Watson (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 10:09:22")
						),
						td(
							div("Required modifications sent by user")
						)
					),
					tr(
						th(
							div("File sent")
						),
						td(
							div("John Watson (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 13:09:22")
						),
						td(
							div("File sent")
						)
					),
					tr(
						th(
							div("Official")
						),
						td(
							div("Sherlock Holmes (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 16:19:22")
						),
						td(
							div("Document accepted")
						)
					)
				)
			)
		)
	);
	section(
		{ class: 'section-primary' },
		div(
			h2("Application revision"),
			p({ class: 'submitted-revision-toolbar' },
				a({ class: 'button-main' }, "Approve file"),
				a({ class: 'button-main' }, "Send for corrections"),
				a({ class: 'button-main' }, "Reject file")
				),
			hr(),
			h3("Required documents"),
			ol({ class: 'submitted-documents-list' },
				li(
					a("Memorandum and articles of association")
				),
				li(
					a("Proof of identity for director 1")
				),
				li(
					a("Proof of identity for director 2")
				),
				li(
					a("Registered title deed")
				)
				),
			h3("Received documents"),
			ol({ class: 'submitted-documents-thumbs' },
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile2.thumb.idoc.png.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile1.thumb.idoc.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status error fa fa-exclamation ' }),
						img({ src: '/uploads/docBSubFile1.thumb.idoc.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile2.thumb.idoc.png.jpg' })
						)
				)
				)
		)
	);
	section(
		{ class: 'section-primary submitted-preview' },
		div({ class: 'submitted-preview-document' },
			h3({ class: 'nav-alternatives' },
				div(i({ class: 'list-item-number' }, "1"),
					"Memorandum and articles of association"
					),
				div(
					a(span({ class: 'fa fa-chevron-circle-left' }, "Previous")),
					span("1 / 4"),
					a(span({ class: 'fa fa-chevron-circle-right' }, "Next"))
				)
				),
			div(
				a(
					img({ src: '/uploads/docASubFile2.idoc.png.jpg' })
				)
			),
			div({ class: 'nav-alternatives nav-alterantiv-single' },
				div(
					a(span({ class: 'fa fa-chevron-circle-left' })),
					span("1" + " / " + "4"),
					a(span({ class: 'fa fa-chevron-circle-right' }))
				)
				),
			form(
				{ class: 'submitted-preview-form' },
				ul(
					{ class: 'form-elements' },
					li(
						div(
							{ class: 'inline-button-radio' },
							label(
								{ class: 'success' },
								input({ type: 'radio' }),
								"Validate document"
							),
							label(
								{ class: 'error' },
								input({ type: 'radio' }),
								"Reject document"
							)
						)
					),
					li(
						div(
							{ class: 'dbjs-input-component' },
							label("Reject document: "),
							div(
								{ class: 'control' },
								select(
									option("Choose rejection reason: "),
									option("Document is not readable."),
									option("The document is not acurate or does not match the data of the form."),
									option("Other")
								)
							)
						)
					)
				),
				input({ type: 'submit' }, "Save")
			)
			),
		div({ class: 'submitted-preview-user-data' },
			h3({ class: 'nav-alternatives' }, "Application form",
				a({ class: 'fa fa-print' }, "Print")
				),
			h4("Proposed company name"),
			table(
				tbody(
					tr(
						td("Blink IT Solutions")
					)
				)
			),
			h4("Business activity"),
			table(
				tbody(
					tr(
						th("Activity"),
						td("Air chater agent")
					),
					tr(
						th("Activity starting date"),
						td("7/30/2014")
					),
					tr(
						th("Date of account year end"),
						td("12/31/2014")
					),
					tr(
						th("Does the company have branches?"),
						td("Yes")
					)
				)
			),
			h4("Company secretary"),
			table(
				tbody(
					tr(
						th("Title"),
						td("Mr")
					),
					tr(
						th("First Name"),
						td("Andrei")
					),
					tr(
						th("Middle Name"),
						td("Mihai")
					),
					tr(
						th("Surname"),
						td("Balan")
					)
				)
			),
			h5("Residential address"),
			table(
				tbody(
					tr(
						th("Plot"),
						td("1")
					),
					tr(
						th("Block"),
						td("1")
					),
					tr(
						th("Street or location"),
						td("Nicolae Filipescu")
					),
					tr(
						th("City, district or town"),
						td("Bucharest")
					),
					tr(
						th("P.O. box"),
						td("1")
					),
					tr(
						th("Country"),
						td("Romania")
					)
				)
			),
			h4("Applicants"),
			h5("Marko Zagola"),
			h6("Personal data"),
			table(
				tbody(
					tr(
						th("Name"),
						td("Marko")
					),
					tr(
						th("Surname"),
						td("Zagalo")
					),
					tr(
						th("Document type"),
						td("X")
					),
					tr(
						th("Document number"),
						td("123")
					),
					tr(
						th("Marital status"),
						td("")
					),
					tr(
						th("Date of birth"),
						td("25-06-1991")
					),
					tr(
						th("Nationality"),
						td("Romanian")
					),
					tr(
						th("E-mail"),
						td("andrei.balan@blink-it.ro")
					)
				)
			),
			h6("Address"),
				table(
				tbody(
					tr(
						th("Address"),
						td("XXX")
					),
					tr(
						th("Number"),
						td("1")
					),
					tr(
						th("Postal code"),
						td("X")
					),
					tr(
						th("City"),
						td("Bucharest")
					),
					tr(
						th("Country"),
						td("Romania")
					)
				)
			)
			)
	);
};
<commit_msg>Changed display of document number in document preview bottom navigation, #107<commit_after>'use strict';

exports['sub-main'] = function () {
	section(
		{ class: 'submitted-main' },
		table(
			{ class: 'submitted-user-data-table table-responsive' },
			thead(
				tr(
					th("Status"),
					th("Application number"),
					th("Application date"),
					th("Requested registrations"),
					th("")
				)
			),
			tbody(
				tr(
					td(
						div({ class: 'cell-caption' },
							"Status"),
						div({ class: 'cell-body' },
							"Pending for revision")
					),
					td(
						div({ class: 'cell-caption' },
							"Application number"),
						div({ class: 'cell-body' },
							"4068-50001-N-2013")
					),
					td(
						div({ class: 'cell-caption' },
							"Application date"),
						div({ class: 'cell-body' },
							"23/07/2014 18:09:22")
					),
					td(
						div({ class: 'cell-caption' },
							"Requested registrations"),
						div({ class: 'cell-body' },
							span({ class: 'label-reg' }, "Brela"),
							span({ class: 'label-reg' }, "Tinc"),
							span({ class: 'label-reg' }, "Vat"),
							span({ class: 'label-reg' }, "Gepf"),
							span({ class: 'label-reg' }, "Nssf"),
							span({ class: 'label-reg' }, "Lapf")
							)
					),
					td(
						div({ class: 'cell-caption' },
							""),
						div({ class: 'cell-body' },
							a({ class: 'fa fa-download' }, "Print")
							)
					)
				)
			)
		)
	);
	section(
		{ class: 'section-primary' },
		div(
			h2({ class: 'nav-alternatives' }, "Application history",
				a({ class: 'fa fa-print' }, "Print")
				),
			table(
				{ class: 'submitted-user-history' },
				tbody(
					tr(
						th(
							div("User")
						),
						td(
							div("John Watson (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 10:09:22")
						),
						td(
							div("Required modifications sent by user")
						)
					),
					tr(
						th(
							div("File sent")
						),
						td(
							div("John Watson (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 13:09:22")
						),
						td(
							div("File sent")
						)
					),
					tr(
						th(
							div("Official")
						),
						td(
							div("Sherlock Holmes (4068-50001-N-2013)")
						),
						td(
							div("24/07/2014 16:19:22")
						),
						td(
							div("Document accepted")
						)
					)
				)
			)
		)
	);
	section(
		{ class: 'section-primary' },
		div(
			h2("Application revision"),
			p({ class: 'submitted-revision-toolbar' },
				a({ class: 'button-main' }, "Approve file"),
				a({ class: 'button-main' }, "Send for corrections"),
				a({ class: 'button-main' }, "Reject file")
				),
			hr(),
			h3("Required documents"),
			ol({ class: 'submitted-documents-list' },
				li(
					a("Memorandum and articles of association")
				),
				li(
					a("Proof of identity for director 1")
				),
				li(
					a("Proof of identity for director 2")
				),
				li(
					a("Registered title deed")
				)
				),
			h3("Received documents"),
			ol({ class: 'submitted-documents-thumbs' },
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile2.thumb.idoc.png.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile1.thumb.idoc.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status error fa fa-exclamation ' }),
						img({ src: '/uploads/docBSubFile1.thumb.idoc.jpg' })
						)
				),
				li(
					a(span({ class: 'review-status success fa fa-check ' }),
						img({ src: '/uploads/docASubFile2.thumb.idoc.png.jpg' })
						)
				)
				)
		)
	);
	section(
		{ class: 'section-primary submitted-preview' },
		div({ class: 'submitted-preview-document' },
			h3({ class: 'nav-alternatives' },
				div(i({ class: 'list-item-number' }, "1"),
					"Memorandum and articles of association"
					),
				div(
					a(span({ class: 'fa fa-chevron-circle-left' }, "Previous")),
					span("1 / 4"),
					a(span({ class: 'fa fa-chevron-circle-right' }, "Next"))
				)
				),
			div(
				a(
					img({ src: '/uploads/docASubFile2.idoc.png.jpg' })
				)
			),
			div({ class: 'nav-alternatives nav-alterantiv-single' },
				div(
					a(span({ class: 'fa fa-chevron-circle-left' })),
					span("1 / 4"),
					a(span({ class: 'fa fa-chevron-circle-right' }))
				)
				),
			form(
				{ class: 'submitted-preview-form' },
				ul(
					{ class: 'form-elements' },
					li(
						div(
							{ class: 'inline-button-radio' },
							label(
								{ class: 'success' },
								input({ type: 'radio' }),
								"Validate document"
							),
							label(
								{ class: 'error' },
								input({ type: 'radio' }),
								"Reject document"
							)
						)
					),
					li(
						div(
							{ class: 'dbjs-input-component' },
							label("Reject document: "),
							div(
								{ class: 'control' },
								select(
									option("Choose rejection reason: "),
									option("Document is not readable."),
									option("The document is not acurate or does not match the data of the form."),
									option("Other")
								)
							)
						)
					)
				),
				input({ type: 'submit' }, "Save")
			)
			),
		div({ class: 'submitted-preview-user-data' },
			h3({ class: 'nav-alternatives' }, "Application form",
				a({ class: 'fa fa-print' }, "Print")
				),
			h4("Proposed company name"),
			table(
				tbody(
					tr(
						td("Blink IT Solutions")
					)
				)
			),
			h4("Business activity"),
			table(
				tbody(
					tr(
						th("Activity"),
						td("Air chater agent")
					),
					tr(
						th("Activity starting date"),
						td("7/30/2014")
					),
					tr(
						th("Date of account year end"),
						td("12/31/2014")
					),
					tr(
						th("Does the company have branches?"),
						td("Yes")
					)
				)
			),
			h4("Company secretary"),
			table(
				tbody(
					tr(
						th("Title"),
						td("Mr")
					),
					tr(
						th("First Name"),
						td("Andrei")
					),
					tr(
						th("Middle Name"),
						td("Mihai")
					),
					tr(
						th("Surname"),
						td("Balan")
					)
				)
			),
			h5("Residential address"),
			table(
				tbody(
					tr(
						th("Plot"),
						td("1")
					),
					tr(
						th("Block"),
						td("1")
					),
					tr(
						th("Street or location"),
						td("Nicolae Filipescu")
					),
					tr(
						th("City, district or town"),
						td("Bucharest")
					),
					tr(
						th("P.O. box"),
						td("1")
					),
					tr(
						th("Country"),
						td("Romania")
					)
				)
			),
			h4("Applicants"),
			h5("Marko Zagola"),
			h6("Personal data"),
			table(
				tbody(
					tr(
						th("Name"),
						td("Marko")
					),
					tr(
						th("Surname"),
						td("Zagalo")
					),
					tr(
						th("Document type"),
						td("X")
					),
					tr(
						th("Document number"),
						td("123")
					),
					tr(
						th("Marital status"),
						td("")
					),
					tr(
						th("Date of birth"),
						td("25-06-1991")
					),
					tr(
						th("Nationality"),
						td("Romanian")
					),
					tr(
						th("E-mail"),
						td("andrei.balan@blink-it.ro")
					)
				)
			),
			h6("Address"),
				table(
				tbody(
					tr(
						th("Address"),
						td("XXX")
					),
					tr(
						th("Number"),
						td("1")
					),
					tr(
						th("Postal code"),
						td("X")
					),
					tr(
						th("City"),
						td("Bucharest")
					),
					tr(
						th("Country"),
						td("Romania")
					)
				)
			)
			)
	);
};
<|endoftext|>


<commit_before>define([
   'esri/units',
   'esri/geometry/Extent',
   'esri/config',
   'esri/tasks/GeometryService',
   'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, GeometryService, ImageParameters) {

    // url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
    esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
    esriConfig.defaults.io.alwaysUseProxy = false;
    // url to your geometry server.
    esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');

    //image parameters for dynamic services, set to png32 for higher quality exports.
    var imageParameters = new ImageParameters();
    imageParameters.format = 'png32';

    return {
        // used for debugging your app
        isDebug: true,

        //default mapClick mode, mapClickMode lets widgets know what mode the map is in to avoid multipult map click actions from taking place (ie identify while drawing).
        defaultMapClickMode: 'identify',
        // map options, passed to map constructor. see: https://developers.arcgis.com/javascript/jsapi/map-amd.html#map1
        mapOptions: {
            basemap: 'streets',
            center: [-96.59179687497497, 39.09596293629694],
            zoom: 5,
            sliderStyle: 'small'
        },
        // panes: {
        // 	left: {
        // 		splitter: true
        // 	},
        // 	right: {
        // 		id: 'sidebarRight',
        // 		placeAt: 'outer',
        // 		region: 'right',
        // 		splitter: true,
        // 		collapsible: true
        // 	},
        // 	bottom: {
        // 		id: 'sidebarBottom',
        // 		placeAt: 'outer',
        // 		splitter: true,
        // 		collapsible: true,
        // 		region: 'bottom'
        // 	},
        // 	top: {
        // 		id: 'sidebarTop',
        // 		placeAt: 'outer',
        // 		collapsible: true,
        // 		splitter: true,
        // 		region: 'top'
        // 	}
        // },
        // collapseButtonsPane: 'center', //center or outer

        // operationalLayers: Array of Layers to load on top of the basemap: valid 'type' options: 'dynamic', 'tiled', 'feature'.
        // The 'options' object is passed as the layers options for constructor. Title will be used in the legend only. id's must be unique and have no spaces.
        // 3 'mode' options: MODE_SNAPSHOT = 0, MODE_ONDEMAND = 1, MODE_SELECTION = 2
        operationalLayers: [{
            type: 'feature',
            url: 'http://services1.arcgis.com/g2TonOxuRkIqSOFx/arcgis/rest/services/MeetUpHomeTowns/FeatureServer/0',
            title: 'STLJS Meetup Home Towns',
            options: {
                id: 'meetupHometowns',
                opacity: 1.0,
                visible: true,
                outFields: ['*'],
                mode: 0
            },
            editorLayerInfos: {
                disableGeometryUpdate: false
            },
            legendLayerInfos: {
                exclude: false,
                layerInfo: {
                    title: 'My layer'
                }
            }
  }, {
            type: 'feature',
            url: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0',
            title: 'San Francisco 311 Incidents',
            options: {
                id: 'sf311Incidents',
                opacity: 1.0,
                visible: true,
                outFields: ['req_type', 'req_date', 'req_time', 'address', 'district'],
                mode: 0
            }
  }, {
            type: 'dynamic',
            url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
            title: 'Louisville Public Safety',
            options: {
                id: 'louisvillePubSafety',
                opacity: 1.0,
                visible: true,
                imageParameters: imageParameters
            },
            identifyLayerInfos: {
                layerIds: [2, 4, 5, 8, 12, 21]
            },
            legendLayerInfos: {
                layerInfo: {
                    hideLayers: [21]
                }
            }
  }, {
            type: 'dynamic',
            url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
            title: 'Damage Assessment',
            options: {
                id: 'DamageAssessment',
                opacity: 1.0,
                visible: true,
                imageParameters: imageParameters
            },
            legendLayerInfos: {
                exclude: true
            },
            layerControlLayerInfos: {
                swipe: true,
                metadataUrl: true,
                expanded: true
            }
  }],
        // set include:true to load. For titlePane type set position the the desired order in the sidebar
        widgets: {
            growler: {
                include: true,
                id: 'growler',
                type: 'domNode',
                path: 'gis/dijit/Growler',
                srcNodeRef: 'growlerDijit',
                options: {}
            },
            geocoder: {
                include: true,
                id: 'geocoder',
                type: 'domNode',
                path: 'gis/dijit/Geocoder',
                srcNodeRef: 'geocodeDijit',
                options: {
                    map: true,
                    mapRightClickMenu: true,
                    geocoderOptions: {
                        autoComplete: true,
                        arcgisGeocoder: {
                            placeholder: 'Enter an address or place'
                        }
                    }
                }
            },
            identify: {
                include: true,
                id: 'identify',
                type: 'titlePane',
                path: 'gis/dijit/Identify',
                title: 'Identify',
                open: false,
                position: 3,
                options: 'config/identify'
            },
            basemaps: {
                include: true,
                id: 'basemaps',
                type: 'domNode',
                path: 'gis/dijit/Basemaps',
                srcNodeRef: 'basemapsDijit',
                options: 'config/basemaps'
            },
            mapInfo: {
                include: false,
                id: 'mapInfo',
                type: 'domNode',
                path: 'gis/dijit/MapInfo',
                srcNodeRef: 'mapInfoDijit',
                options: {
                    map: true,
                    mode: 'dms',
                    firstCoord: 'y',
                    unitScale: 3,
                    showScale: true,
                    xLabel: '',
                    yLabel: '',
                    minWidth: 286
                }
            },
            scalebar: {
                include: true,
                id: 'scalebar',
                type: 'map',
                path: 'esri/dijit/Scalebar',
                options: {
                    map: true,
                    attachTo: 'bottom-left',
                    scalebarStyle: 'line',
                    scalebarUnit: 'dual'
                }
            },
            locateButton: {
                include: true,
                id: 'locateButton',
                type: 'domNode',
                path: 'gis/dijit/LocateButton',
                srcNodeRef: 'locateButton',
                options: {
                    map: true,
                    publishGPSPosition: true,
                    highlightLocation: true,
                    useTracking: true,
                    geolocationOptions: {
                        maximumAge: 0,
                        timeout: 15000,
                        enableHighAccuracy: true
                    }
                }
            },
            overviewMap: {
                include: true,
                id: 'overviewMap',
                type: 'map',
                path: 'esri/dijit/OverviewMap',
                options: {
                    map: true,
                    attachTo: 'bottom-right',
                    color: '#0000CC',
                    height: 100,
                    width: 125,
                    opacity: 0.30,
                    visible: false
                }
            },
            homeButton: {
                include: true,
                id: 'homeButton',
                type: 'domNode',
                path: 'esri/dijit/HomeButton',
                srcNodeRef: 'homeButton',
                options: {
                    map: true,
                    extent: new Extent({
                        xmin: -180,
                        ymin: -85,
                        xmax: 180,
                        ymax: 85,
                        spatialReference: {
                            wkid: 4326
                        }
                    })
                }
            },
            legend: {
                include: true,
                id: 'legend',
                type: 'titlePane',
                path: 'esri/dijit/Legend',
                title: 'Legend',
                open: false,
                position: 0,
                options: {
                    map: true,
                    legendLayerInfos: true
                }
            },
            layerControl: {
                include: true,
                id: 'layerControl',
                type: 'titlePane',
                path: 'gis/dijit/LayerControl',
                title: 'Layers',
                open: false,
                position: 0,
                options: {
                    map: true,
                    layerControlLayerInfos: true,
                    separated: true,
                    vectorReorder: true,
                    overlayReorder: true
                }
            },
            bookmarks: {
                include: true,
                id: 'bookmarks',
                type: 'titlePane',
                path: 'gis/dijit/Bookmarks',
                title: 'Bookmarks',
                open: false,
                position: 2,
                options: 'config/bookmarks'
            },
            find: {
                include: true,
                id: 'find',
                type: 'titlePane',
                canFloat: true,
                path: 'gis/dijit/Find',
                title: 'Find',
                open: false,
                position: 3,
                options: 'config/find'
            },
            draw: {
                include: true,
                id: 'draw',
                type: 'titlePane',
                canFloat: true,
                path: 'gis/dijit/Draw',
                title: 'Draw',
                open: false,
                position: 4,
                options: {
                    map: true,
                    mapClickMode: true
                }
            },
            measure: {
                include: true,
                id: 'measurement',
                type: 'titlePane',
                canFloat: true,
                path: 'gis/dijit/Measurement',
                title: 'Measurement',
                open: false,
                position: 5,
                options: {
                    map: true,
                    mapClickMode: true,
                    defaultAreaUnit: units.SQUARE_MILES,
                    defaultLengthUnit: units.MILES
                }
            },
            print: {
                include: true,
                id: 'print',
                type: 'titlePane',
                canFloat: true,
                path: 'gis/dijit/Print',
                title: 'Print',
                open: false,
                position: 6,
                options: {
                    map: true,
                    printTaskURL: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
                    copyrightText: 'Copyright 2014',
                    authorText: 'Me',
                    defaultTitle: 'Viewer Map',
                    defaultFormat: 'PDF',
                    defaultLayout: 'Letter ANSI A Landscape'
                }
            },
            directions: {
                include: true,
                id: 'directions',
                type: 'titlePane',
                path: 'gis/dijit/Directions',
                title: 'Directions',
                open: false,
                position: 7,
                options: {
                    map: true,
                    mapRightClickMenu: true,
                    options: {
                        routeTaskUrl: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route',
                        routeParams: {
                            directionsLanguage: 'en-US',
                            directionsLengthUnits: units.MILES
                        },
                        active: false //for 3.12, starts active by default, which we dont want as it interfears with mapClickMode
                    }
                }
            },
            editor: {
                include: true,
                id: 'editor',
                type: 'titlePane',
                path: 'gis/dijit/Editor',
                title: 'Editor',
                open: false,
                position: 8,
                options: {
                    map: true,
                    mapClickMode: true,
                    editorLayerInfos: true,
                    settings: {
                        toolbarVisible: true,
                        showAttributesOnClick: true,
                        enableUndoRedo: true,
                        createOptions: {
                            polygonDrawTools: ['freehandpolygon', 'autocomplete']
                        },
                        toolbarOptions: {
                            reshapeVisible: true,
                            cutVisible: true,
                            mergeVisible: true
                        }
                    }
                }
            },
            streetview: {
                include: true,
                id: 'streetview',
                type: 'titlePane',
                canFloat: true,
                position: 9,
                path: 'gis/dijit/StreetView',
                title: 'Google Street View',
                options: {
                    map: true,
                    mapClickMode: true,
                    mapRightClickMenu: true
                }
            },
            help: {
                include: true,
                id: 'help',
                type: 'floating',
                path: 'gis/dijit/Help',
                title: 'Help',
                options: {}
            }

        }
    };
});<commit_msg>Clean up indentation<commit_after>define([
  'esri/units',
  'esri/geometry/Extent',
  'esri/config',
  'esri/tasks/GeometryService',
  'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, GeometryService, ImageParameters) {

  // url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
  esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
  esriConfig.defaults.io.alwaysUseProxy = false;
  // url to your geometry server.
  esriConfig.defaults.geometryService = new GeometryService('http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer');

  //image parameters for dynamic services, set to png32 for higher quality exports.
  var imageParameters = new ImageParameters();
  imageParameters.format = 'png32';

  return {
    // used for debugging your app
    isDebug: true,

    //default mapClick mode, mapClickMode lets widgets know what mode the map is in to avoid multipult map click actions from taking place (ie identify while drawing).
    defaultMapClickMode: 'identify',
    // map options, passed to map constructor. see: https://developers.arcgis.com/javascript/jsapi/map-amd.html#map1
    mapOptions: {
      basemap: 'streets',
      center: [-96.59179687497497, 39.09596293629694],
      zoom: 5,
      sliderStyle: 'small'
    },
    // panes: {
    // 	left: {
    // 		splitter: true
    // 	},
    // 	right: {
    // 		id: 'sidebarRight',
    // 		placeAt: 'outer',
    // 		region: 'right',
    // 		splitter: true,
    // 		collapsible: true
    // 	},
    // 	bottom: {
    // 		id: 'sidebarBottom',
    // 		placeAt: 'outer',
    // 		splitter: true,
    // 		collapsible: true,
    // 		region: 'bottom'
    // 	},
    // 	top: {
    // 		id: 'sidebarTop',
    // 		placeAt: 'outer',
    // 		collapsible: true,
    // 		splitter: true,
    // 		region: 'top'
    // 	}
    // },
    // collapseButtonsPane: 'center', //center or outer

    // operationalLayers: Array of Layers to load on top of the basemap: valid 'type' options: 'dynamic', 'tiled', 'feature'.
    // The 'options' object is passed as the layers options for constructor. Title will be used in the legend only. id's must be unique and have no spaces.
    // 3 'mode' options: MODE_SNAPSHOT = 0, MODE_ONDEMAND = 1, MODE_SELECTION = 2
    operationalLayers: [{
      type: 'feature',
      url: 'http://services1.arcgis.com/g2TonOxuRkIqSOFx/arcgis/rest/services/MeetUpHomeTowns/FeatureServer/0',
      title: 'STLJS Meetup Home Towns',
      options: {
        id: 'meetupHometowns',
        opacity: 1.0,
        visible: true,
        outFields: ['*'],
        mode: 0
      },
      editorLayerInfos: {
        disableGeometryUpdate: false
      },
      legendLayerInfos: {
        exclude: false,
        layerInfo: {
          title: 'My layer'
        }
      }
    }, {
      type: 'feature',
      url: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0',
      title: 'San Francisco 311 Incidents',
      options: {
        id: 'sf311Incidents',
        opacity: 1.0,
        visible: true,
        outFields: ['req_type', 'req_date', 'req_time', 'address', 'district'],
        mode: 0
      }
    }, {
      type: 'dynamic',
      url: 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer',
      title: 'Louisville Public Safety',
      options: {
        id: 'louisvillePubSafety',
        opacity: 1.0,
        visible: true,
        imageParameters: imageParameters
      },
      identifyLayerInfos: {
        layerIds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      },
      legendLayerInfos: {
        layerInfo: {
          hideLayers: [21]
        }
      }
    }, {
      type: 'dynamic',
      url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer',
      title: 'Damage Assessment',
      options: {
        id: 'DamageAssessment',
        opacity: 1.0,
        visible: true,
        imageParameters: imageParameters
      },
      legendLayerInfos: {
        exclude: true
      },
      layerControlLayerInfos: {
        swipe: true,
        metadataUrl: true,
        expanded: true
      }
    }],
    // set include:true to load. For titlePane type set position the the desired order in the sidebar
    widgets: {
      growler: {
        include: true,
        id: 'growler',
        type: 'domNode',
        path: 'gis/dijit/Growler',
        srcNodeRef: 'growlerDijit',
        options: {}
      },
      geocoder: {
        include: true,
        id: 'geocoder',
        type: 'domNode',
        path: 'gis/dijit/Geocoder',
        srcNodeRef: 'geocodeDijit',
        options: {
          map: true,
          mapRightClickMenu: true,
          geocoderOptions: {
            autoComplete: true,
            arcgisGeocoder: {
              placeholder: 'Enter an address or place'
            }
          }
        }
      },
      identify: {
        include: true,
        id: 'identify',
        type: 'titlePane',
        path: 'gis/dijit/Identify',
        title: 'Identify',
        open: false,
        position: 3,
        options: 'config/identify'
      },
      basemaps: {
        include: true,
        id: 'basemaps',
        type: 'domNode',
        path: 'gis/dijit/Basemaps',
        srcNodeRef: 'basemapsDijit',
        options: 'config/basemaps'
      },
      mapInfo: {
        include: false,
        id: 'mapInfo',
        type: 'domNode',
        path: 'gis/dijit/MapInfo',
        srcNodeRef: 'mapInfoDijit',
        options: {
          map: true,
          mode: 'dms',
          firstCoord: 'y',
          unitScale: 3,
          showScale: true,
          xLabel: '',
          yLabel: '',
          minWidth: 286
        }
      },
      scalebar: {
        include: true,
        id: 'scalebar',
        type: 'map',
        path: 'esri/dijit/Scalebar',
        options: {
          map: true,
          attachTo: 'bottom-left',
          scalebarStyle: 'line',
          scalebarUnit: 'dual'
        }
      },
      locateButton: {
        include: true,
        id: 'locateButton',
        type: 'domNode',
        path: 'gis/dijit/LocateButton',
        srcNodeRef: 'locateButton',
        options: {
          map: true,
          publishGPSPosition: true,
          highlightLocation: true,
          useTracking: true,
          geolocationOptions: {
            maximumAge: 0,
            timeout: 15000,
            enableHighAccuracy: true
          }
        }
      },
      overviewMap: {
        include: true,
        id: 'overviewMap',
        type: 'map',
        path: 'esri/dijit/OverviewMap',
        options: {
          map: true,
          attachTo: 'bottom-right',
          color: '#0000CC',
          height: 100,
          width: 125,
          opacity: 0.30,
          visible: false
        }
      },
      homeButton: {
        include: true,
        id: 'homeButton',
        type: 'domNode',
        path: 'esri/dijit/HomeButton',
        srcNodeRef: 'homeButton',
        options: {
          map: true,
          extent: new Extent({
            xmin: -180,
            ymin: -85,
            xmax: 180,
            ymax: 85,
            spatialReference: {
              wkid: 4326
            }
          })
        }
      },
      legend: {
        include: true,
        id: 'legend',
        type: 'titlePane',
        path: 'esri/dijit/Legend',
        title: 'Legend',
        open: false,
        position: 0,
        options: {
          map: true,
          legendLayerInfos: true
        }
      },
      layerControl: {
        include: true,
        id: 'layerControl',
        type: 'titlePane',
        path: 'gis/dijit/LayerControl',
        title: 'Layers',
        open: false,
        position: 0,
        options: {
          map: true,
          layerControlLayerInfos: true,
          separated: true,
          vectorReorder: true,
          overlayReorder: true
        }
      },
      bookmarks: {
        include: true,
        id: 'bookmarks',
        type: 'titlePane',
        path: 'gis/dijit/Bookmarks',
        title: 'Bookmarks',
        open: false,
        position: 2,
        options: 'config/bookmarks'
      },
      find: {
        include: true,
        id: 'find',
        type: 'titlePane',
        canFloat: true,
        path: 'gis/dijit/Find',
        title: 'Find',
        open: false,
        position: 3,
        options: 'config/find'
      },
      draw: {
        include: true,
        id: 'draw',
        type: 'titlePane',
        canFloat: true,
        path: 'gis/dijit/Draw',
        title: 'Draw',
        open: false,
        position: 4,
        options: {
          map: true,
          mapClickMode: true
        }
      },
      measure: {
        include: true,
        id: 'measurement',
        type: 'titlePane',
        canFloat: true,
        path: 'gis/dijit/Measurement',
        title: 'Measurement',
        open: false,
        position: 5,
        options: {
          map: true,
          mapClickMode: true,
          defaultAreaUnit: units.SQUARE_MILES,
          defaultLengthUnit: units.MILES
        }
      },
      print: {
        include: true,
        id: 'print',
        type: 'titlePane',
        canFloat: true,
        path: 'gis/dijit/Print',
        title: 'Print',
        open: false,
        position: 6,
        options: {
          map: true,
          printTaskURL: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',
          copyrightText: 'Copyright 2014',
          authorText: 'Me',
          defaultTitle: 'Viewer Map',
          defaultFormat: 'PDF',
          defaultLayout: 'Letter ANSI A Landscape'
        }
      },
      directions: {
        include: true,
        id: 'directions',
        type: 'titlePane',
        path: 'gis/dijit/Directions',
        title: 'Directions',
        open: false,
        position: 7,
        options: {
          map: true,
          mapRightClickMenu: true,
          options: {
            routeTaskUrl: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route',
            routeParams: {
              directionsLanguage: 'en-US',
              directionsLengthUnits: units.MILES
            },
            active: false //for 3.12, starts active by default, which we dont want as it interfears with mapClickMode
          }
        }
      },
      editor: {
        include: true,
        id: 'editor',
        type: 'titlePane',
        path: 'gis/dijit/Editor',
        title: 'Editor',
        open: false,
        position: 8,
        options: {
          map: true,
          mapClickMode: true,
          editorLayerInfos: true,
          settings: {
            toolbarVisible: true,
            showAttributesOnClick: true,
            enableUndoRedo: true,
            createOptions: {
              polygonDrawTools: ['freehandpolygon', 'autocomplete']
            },
            toolbarOptions: {
              reshapeVisible: true,
              cutVisible: true,
              mergeVisible: true
            }
          }
        }
      },
      streetview: {
        include: true,
        id: 'streetview',
        type: 'titlePane',
        canFloat: true,
        position: 9,
        path: 'gis/dijit/StreetView',
        title: 'Google Street View',
        options: {
          map: true,
          mapClickMode: true,
          mapRightClickMenu: true
        }
      },
      help: {
        include: true,
        id: 'help',
        type: 'floating',
        path: 'gis/dijit/Help',
        title: 'Help',
        options: {}
      }

    }
  };
});
<|endoftext|>


<commit_before>// @flow
import React from 'react'
import {StyleSheet, Text, View} from 'react-native'

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    textAlign: 'center',
    backgroundColor: '#ffffff',
  },
})

export function NoticeView({text, style}: {text: string, style?: any}) {
  return (
    <View style={[styles.container, style]}>
      <Text>
        {text}
      </Text>
    </View>
  )
}
<commit_msg>fix textAlign application to NoticeView (#450)<commit_after>// @flow
import React from 'react'
import {StyleSheet, Text, View} from 'react-native'

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#ffffff',
  },
  text: {
    textAlign: 'center',
  },
})

export function NoticeView({text, style}: {text: string, style?: any}) {
  return (
    <View style={[styles.container, style]}>
      <Text style={styles.text}>
        {text}
      </Text>
    </View>
  )
}
<|endoftext|>


<commit_before>/*
 * Copyright (c) 2022 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */

describe('Displays', function () {

    beforeEach(function () {
        cy.login();
    });

    it('should display map and revert back to table', function() {

        cy.visit('/display/view');

        cy.get('#displays_wrapper.dataTables_wrapper').should('be.visible');

        cy.get('#map_button').click();

        cy.wait(500);

        cy.get('#map.leaflet-container').should('be.visible');

        cy.get('#list_button').click();

        cy.get('#displays_wrapper.dataTables_wrapper').should('be.visible');
    });
});<commit_msg>Fix cypress<commit_after>/*
 * Copyright (c) 2022 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */

describe('Displays', function () {

    beforeEach(function () {
        cy.login();
    });

    it('should display map and revert back to table', function() {

        cy.visit('/display/view');

        cy.get('#displays_wrapper.dataTables_wrapper').should('be.visible');

        cy.get('#map.leaflet-container').should('not.be.visible');

        cy.get('#map_button').click();

        cy.get('#map.leaflet-container').should('be.visible');

        cy.get('#list_button').click();

        cy.get('#displays_wrapper.dataTables_wrapper').should('be.visible');
    });
});<|endoftext|>


<commit_before>import Ember from 'ember';
import EditFormController from 'ember-flexberry/controllers/edit-form';

export default EditFormController.extend({
  /**
    Defaul style of modal context.

    @property readonly
    @type String
    @default #example
  */
  _style:'#example',

  actions: {
    modalWindow(style) {
      if (!Ember.isNone(style)) {
        this.set('_style', style);
      }

      let repeatWindow = Ember.$('#repeat-window').modal({
        closable: false,
        autofocus: false,
        detachable: false,
        allowMultiple: true,
        context: this.get('_style'),
      });
      this.set('repeatWindow', repeatWindow);
      this.get('repeatWindow').modal('show').modal('refresh');
    },

    modalWindowDouble(style) {
      if (!Ember.isNone(style)) {
        this.set('_style', style);
      }

      let repeatWindow = Ember.$('#repeat-window-double').modal({
        closable: false,
        autofocus: false,
        detachable: false,
        allowMultiple: true,
        context: this.get('_style'),
      });
      this.set('repeatWindowdouble', repeatWindow);
      this.get('repeatWindowdouble').modal('show').modal('refresh');
    },

    logOut() {
      this.get('repeatWindow').modal('hide');
    },

    logOutDouble() {
      this.get('repeatWindowdouble').modal('hide');
    }

  }
});
<commit_msg>Add configuration<commit_after>import Ember from 'ember';
import EditFormController from 'ember-flexberry/controllers/edit-form';
import config from 'dummy/config/environment';

export default EditFormController.extend({
  /**
    Defaul style of modal context.

    @property readonly
    @type String
    @default #example
  */
  _style:'#example',

  /**
    File upload URL for 'flexberry-file' component 'uploadUrl' property.

    @property uploadUrl
    @type String
   */
  uploadUrl: config.APP.components.flexberryFile.uploadUrl,

  /**
    Flag for 'flexberry-file' component 'showPreview' property.

    @property showPreview
    @type Boolean
   */
  showPreview: true,

  /**
    Flag for 'flexberry-file' component 'showUploadButton' property.

    @property showUploadButton
    @type Boolean
   */
  showUploadButton: true,

  /**
    Flag for 'flexberry-file' component 'showDownloadButton' property.

    @property showDownloadButton
    @type Boolean
   */
  showDownloadButton: true,

  actions: {
    modalWindow(style) {
      if (!Ember.isNone(style)) {
        this.set('_style', style);
      }

      let repeatWindow = Ember.$('#repeat-window').modal({
        closable: false,
        autofocus: false,
        detachable: false,
        allowMultiple: true,
        context: this.get('_style'),
      });
      this.set('repeatWindow', repeatWindow);
      this.get('repeatWindow').modal('show').modal('refresh');
    },

    modalWindowDouble(style) {
      if (!Ember.isNone(style)) {
        this.set('_style', style);
      }

      let repeatWindow = Ember.$('#repeat-window-double').modal({
        closable: false,
        autofocus: false,
        detachable: false,
        allowMultiple: true,
        context: this.get('_style'),
      });
      this.set('repeatWindowdouble', repeatWindow);
      this.get('repeatWindowdouble').modal('show').modal('refresh');
    },

    logOut() {
      this.get('repeatWindow').modal('hide');
    },

    logOutDouble() {
      this.get('repeatWindowdouble').modal('hide');
    }

  }
});
<|endoftext|>


<commit_before>import initSpecFile from '../utils/init-spec-file';

const testConfig = [
  {
    title: 'Validates otf service displays widgets correctly',
    tests: [
      {
        slug: 'default',
        description: 'Gana shape Testing OTF tree cover gain',
        visit:
          '/map/geostore/6d5cfdf69bf468fc9b22c420e3c52d20/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0Ijo2LjQ4MDk3MTM4MTE4ODg4MiwibG5nIjotMS4xMzY1ODQ5ODg5ODI0OTU3fSwiem9vbSI6Ny45NTc5NzcyNjkxODQzMSwiY2FuQm91bmQiOmZhbHNlLCJkYXRhc2V0cyI6W3siZGF0YXNldCI6InRyZWUtY292ZXItZ2FpbiIsIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWUsImxheWVycyI6WyJ0cmVlLWNvdmVyLWdhaW4tMjAwMS0yMDEyIl19LHsiZGF0YXNldCI6InBvbGl0aWNhbC1ib3VuZGFyaWVzIiwibGF5ZXJzIjpbImRpc3B1dGVkLXBvbGl0aWNhbC1ib3VuZGFyaWVzIiwicG9saXRpY2FsLWJvdW5kYXJpZXMiXSwib3BhY2l0eSI6MSwidmlzaWJpbGl0eSI6dHJ1ZX1dfQ%3D%3D&mapMenu=eyJkYXRhc2V0Q2F0ZWdvcnkiOiJmb3Jlc3RDaGFuZ2UifQ%3D%3D&mapPrompts=eyJvcGVuIjp0cnVlLCJzdGVwc0tleSI6InN1YnNjcmliZVRvQXJlYSIsInN0ZXBzSW5kZXgiOjB9',
        test: 'sentence-treeCoverGainSimple',
        sentence:
          'From {yearStart} to {yearEnd}, Area near Ashanti Region, Ghana gained {valueGain} of tree cover equal to {valueExtent} is its total extent.',
      },
      {
        slug: 'default',
        description: 'Rio Branco shape Testing OTF tree cover loss',
        visit:
          '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43OTk1NDczMDQwNjM5ODMsImxuZyI6LTY3LjgzNjM2NDI5MDkzNDExfSwiem9vbSI6MTEuOTY2ODg2Njk1ODc3MDA2LCJjYW5Cb3VuZCI6ZmFsc2UsImRhdGFzZXRzIjpbeyJkYXRhc2V0IjoicG9saXRpY2FsLWJvdW5kYXJpZXMiLCJsYXllcnMiOlsiZGlzcHV0ZWQtcG9saXRpY2FsLWJvdW5kYXJpZXMiLCJwb2xpdGljYWwtYm91bmRhcmllcyJdLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlfSx7ImRhdGFzZXQiOiJ0cmVlLWNvdmVyLWxvc3MiLCJsYXllcnMiOlsidHJlZS1jb3Zlci1sb3NzIl0sIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWV9XX0%3D',
        test: 'sentence-treeLoss',
        sentence:
          'From {startYear} to {endYear}, Area in Acre, Brazil lost {loss} of tree cover, equivalent to a {percent} decrease in tree cover since {extentYear}.',
      },
      {
        slug: 'default',
        description: 'Rio Branco shape Testing OTF tree cover extent 2000',
        visit:
          '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43ODk4NTQ0NDk2NjI0OTIsImxuZyI6LTY3LjgxNDg0NzUzNTk4MzE2fSwiem9vbSI6MTMuMzc2NDA3MTg0NjQ0NzYsImNhbkJvdW5kIjpmYWxzZSwiZGF0YXNldHMiOlt7ImRhdGFzZXQiOiJ0cmVlLWNvdmVyIiwib3BhY2l0eSI6MSwidmlzaWJpbGl0eSI6dHJ1ZSwibGF5ZXJzIjpbInRyZWUtY292ZXItMjAwMCJdfSx7ImRhdGFzZXQiOiJwb2xpdGljYWwtYm91bmRhcmllcyIsImxheWVycyI6WyJkaXNwdXRlZC1wb2xpdGljYWwtYm91bmRhcmllcyIsInBvbGl0aWNhbC1ib3VuZGFyaWVzIl0sIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWV9XX0%3D&mapMenu=eyJtZW51U2VjdGlvbiI6ImRhdGFzZXRzIiwiZGF0YXNldENhdGVnb3J5IjoibGFuZENvdmVyIn0%3D',
        test: 'sentence-treeCover2000',
        sentence:
          'As of {year}, {percentage} of Area in Acre, Brazil was tree cover.',
      },
      // {
      //   slug: 'default',
      //   description: 'Rio Branco shape Testing OTF glad',
      //   visit:
      //     '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43ODk4NTQ0NDk2NjE2NjYsImxuZyI6LTY3LjgxNDg0NzUzNTk3NzM0fSwiem9vbSI6MTMuMzM2NDc1NzEyMzY5Nzc2LCJkYXRhc2V0cyI6W3siZGF0YXNldCI6ImdsYWQtZGVmb3Jlc3RhdGlvbi1hbGVydHMiLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlLCJsYXllcnMiOlsiZGVmb3Jlc3RhdGlvbi1hbGVydHMtZ2xhZCJdLCJ0aW1lbGluZVBhcmFtcyI6eyJzdGFydERhdGUiOiIyMDE1LTAxLTAxIiwiZW5kRGF0ZSI6IjIwMTUtMTItMzEiLCJ0cmltRW5kRGF0ZSI6IjIwMTUtMTItMzEifX0seyJkYXRhc2V0IjoicG9saXRpY2FsLWJvdW5kYXJpZXMiLCJsYXllcnMiOlsiZGlzcHV0ZWQtcG9saXRpY2FsLWJvdW5kYXJpZXMiLCJwb2xpdGljYWwtYm91bmRhcmllcyJdLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlfV19&mapMenu=eyJtZW51U2VjdGlvbiI6ImRhdGFzZXRzIiwiZGF0YXNldENhdGVnb3J5IjoiZm9yZXN0Q2hhbmdlIn0%3D',
      //   test: 'sentence-gladAlerts',
      //   sentence:
      //     'There were {count} GLAD alerts reported in the week of the {date}. This was {status} compared to the same week in previous years.',
      // },
    ],
    spec: {
      test: (sheet) => {
        cy.visit(sheet.visit, {
          timeout: 500000,
          retryOnStatusCodeFailure: true,
          // https://github.com/cypress-io/cypress/issues/943#issuecomment-730705557
          headers: { 'Accept-Encoding': 'gzip, deflate' },
        });
        // Agree cookies
        cy.get('.cookies-button > button').click();
        // Close welcome modal
        cy.get('.modal-close').click();
        cy.wait(1000); // eslint-disable-line
        cy.isValidSentence(sheet.test, sheet.sentence);
      },
    },
  },
];

// Title, config, lock = if true, fixtures will be locked even in recording mode
initSpecFile('OTF spec', testConfig, true);
<commit_msg>Updating failing OTF service widget test with updated URL<commit_after>import initSpecFile from '../utils/init-spec-file';

const testConfig = [
  {
    title: 'Validates otf service displays widgets correctly',
    tests: [
      {
        slug: 'default',
        description: 'Gana shape Testing OTF tree cover gain',
        visit:
          '/map/geostore/6d5cfdf69bf468fc9b22c420e3c52d20/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0Ijo2LjQ4MDk3MTM4MTE4ODg4MiwibG5nIjotMS4xMzY1ODQ5ODg5ODI0OTU3fSwiem9vbSI6Ny45NTc5NzcyNjkxODQzMSwiZGF0YXNldHMiOlt7ImRhdGFzZXQiOiJ0cmVlLWNvdmVyLWdhaW4iLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlLCJsYXllcnMiOlsidHJlZS1jb3Zlci1nYWluLTIwMDEtMjAyMCJdfSx7ImRhdGFzZXQiOiJwb2xpdGljYWwtYm91bmRhcmllcyIsImxheWVycyI6WyJkaXNwdXRlZC1wb2xpdGljYWwtYm91bmRhcmllcyIsInBvbGl0aWNhbC1ib3VuZGFyaWVzIl0sIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWV9XX0%3D&mapMenu=eyJtZW51U2VjdGlvbiI6ImRhdGFzZXRzIiwiZGF0YXNldENhdGVnb3J5IjoiZm9yZXN0Q2hhbmdlIn0%3D&mapPrompts=eyJvcGVuIjp0cnVlLCJzdGVwc0tleSI6InN1YnNjcmliZVRvQXJlYSIsInN0ZXBzSW5kZXgiOjB9',
        test: 'sentence-treeCoverGainSimple',
        sentence:
          'From {yearStart} to {yearEnd}, Area near Ashanti Region, Ghana gained {valueGain} of tree cover equal to {valueExtent} is its total extent.',
      },
      {
        slug: 'default',
        description: 'Rio Branco shape Testing OTF tree cover loss',
        visit:
          '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43OTk1NDczMDQwNjM5ODMsImxuZyI6LTY3LjgzNjM2NDI5MDkzNDExfSwiem9vbSI6MTEuOTY2ODg2Njk1ODc3MDA2LCJjYW5Cb3VuZCI6ZmFsc2UsImRhdGFzZXRzIjpbeyJkYXRhc2V0IjoicG9saXRpY2FsLWJvdW5kYXJpZXMiLCJsYXllcnMiOlsiZGlzcHV0ZWQtcG9saXRpY2FsLWJvdW5kYXJpZXMiLCJwb2xpdGljYWwtYm91bmRhcmllcyJdLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlfSx7ImRhdGFzZXQiOiJ0cmVlLWNvdmVyLWxvc3MiLCJsYXllcnMiOlsidHJlZS1jb3Zlci1sb3NzIl0sIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWV9XX0%3D',
        test: 'sentence-treeLoss',
        sentence:
          'From {startYear} to {endYear}, Area in Acre, Brazil lost {loss} of tree cover, equivalent to a {percent} decrease in tree cover since {extentYear}.',
      },
      {
        slug: 'default',
        description: 'Rio Branco shape Testing OTF tree cover extent 2000',
        visit:
          '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43ODk4NTQ0NDk2NjI0OTIsImxuZyI6LTY3LjgxNDg0NzUzNTk4MzE2fSwiem9vbSI6MTMuMzc2NDA3MTg0NjQ0NzYsImNhbkJvdW5kIjpmYWxzZSwiZGF0YXNldHMiOlt7ImRhdGFzZXQiOiJ0cmVlLWNvdmVyIiwib3BhY2l0eSI6MSwidmlzaWJpbGl0eSI6dHJ1ZSwibGF5ZXJzIjpbInRyZWUtY292ZXItMjAwMCJdfSx7ImRhdGFzZXQiOiJwb2xpdGljYWwtYm91bmRhcmllcyIsImxheWVycyI6WyJkaXNwdXRlZC1wb2xpdGljYWwtYm91bmRhcmllcyIsInBvbGl0aWNhbC1ib3VuZGFyaWVzIl0sIm9wYWNpdHkiOjEsInZpc2liaWxpdHkiOnRydWV9XX0%3D&mapMenu=eyJtZW51U2VjdGlvbiI6ImRhdGFzZXRzIiwiZGF0YXNldENhdGVnb3J5IjoibGFuZENvdmVyIn0%3D',
        test: 'sentence-treeCover2000',
        sentence:
          'As of {year}, {percentage} of Area in Acre, Brazil was tree cover.',
      },
      // {
      //   slug: 'default',
      //   description: 'Rio Branco shape Testing OTF glad',
      //   visit:
      //     '/map/geostore/211fca3fbea311473797cc967bc7a073/?analysis=eyJzaG93RHJhdyI6dHJ1ZX0%3D&mainMap=eyJzaG93QW5hbHlzaXMiOnRydWV9&map=eyJjZW50ZXIiOnsibGF0IjotOS43ODk4NTQ0NDk2NjE2NjYsImxuZyI6LTY3LjgxNDg0NzUzNTk3NzM0fSwiem9vbSI6MTMuMzM2NDc1NzEyMzY5Nzc2LCJkYXRhc2V0cyI6W3siZGF0YXNldCI6ImdsYWQtZGVmb3Jlc3RhdGlvbi1hbGVydHMiLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlLCJsYXllcnMiOlsiZGVmb3Jlc3RhdGlvbi1hbGVydHMtZ2xhZCJdLCJ0aW1lbGluZVBhcmFtcyI6eyJzdGFydERhdGUiOiIyMDE1LTAxLTAxIiwiZW5kRGF0ZSI6IjIwMTUtMTItMzEiLCJ0cmltRW5kRGF0ZSI6IjIwMTUtMTItMzEifX0seyJkYXRhc2V0IjoicG9saXRpY2FsLWJvdW5kYXJpZXMiLCJsYXllcnMiOlsiZGlzcHV0ZWQtcG9saXRpY2FsLWJvdW5kYXJpZXMiLCJwb2xpdGljYWwtYm91bmRhcmllcyJdLCJvcGFjaXR5IjoxLCJ2aXNpYmlsaXR5Ijp0cnVlfV19&mapMenu=eyJtZW51U2VjdGlvbiI6ImRhdGFzZXRzIiwiZGF0YXNldENhdGVnb3J5IjoiZm9yZXN0Q2hhbmdlIn0%3D',
      //   test: 'sentence-gladAlerts',
      //   sentence:
      //     'There were {count} GLAD alerts reported in the week of the {date}. This was {status} compared to the same week in previous years.',
      // },
    ],
    spec: {
      test: (sheet) => {
        cy.visit(sheet.visit, {
          timeout: 500000,
          retryOnStatusCodeFailure: true,
          // https://github.com/cypress-io/cypress/issues/943#issuecomment-730705557
          headers: { 'Accept-Encoding': 'gzip, deflate' },
        });
        // Agree cookies
        cy.get('.cookies-button > button').click();
        // Close welcome modal
        cy.get('.modal-close').click();
        cy.wait(1000); // eslint-disable-line
        cy.isValidSentence(sheet.test, sheet.sentence);
      },
    },
  },
];

// Title, config, lock = if true, fixtures will be locked even in recording mode
initSpecFile('OTF spec', testConfig, true);
<|endoftext|>


<commit_before>describe('Test', function(){

it('should enter session Id', function(){

browser.get("http://localhost:8000/");
var input = element(by.model('homeVm.sessionId'));
input.sendKeys("HJEFJK23");

});

});<commit_msg>added protractor tests<commit_after>describe('Test', function(){

it('should open the user page', function(){

	browser.get("http://localhost:8000/");
	var button = element(by.id('createSession'));
	button.click();
	expect(browser.getCurrentUrl()).toEqual("http://localhost:8000/user");

});

it('should create a session and add a user', function(){

	browser.get("http://localhost:8000/");
	var button = element(by.id('createSession'));
	button.click();
	var input = element(by.id('username'));
	input.sendKeys('Simona');
	var joinButton = element(by.id('joinSession'));
	joinButton.click();
	expect(element(by.id('addStart')).isPresent()).toBe(true);

});

it('should join an existing session', function(){

	browser.get("http://localhost:8000/");
	var inputSession = element(by.id('sessionId'));
	inputSession.sendKeys('testing123');
	var joinSessionBtn = element(by.id('enterSession'));
	joinSessionBtn.click();
	var input = element(by.id('username'));
	input.sendKeys('Simona1');
	var joinButton = element(by.id('joinSession'));
	joinButton.click();
	browser.sleep(3000);
	expect(element(by.id('addStart')).isPresent()).toBe(true);

});

it('should add user to active users', function(){

	browser.get("http://localhost:8000/");
	var inputSession = element(by.id('sessionId'));
	inputSession.sendKeys('testing123');
	var joinSessionBtn = element(by.id('enterSession'));
	joinSessionBtn.click();
	var input = element(by.id('username'));
	input.sendKeys('Simona');
	var joinButton = element(by.id('joinSession'));
	joinButton.click();
	browser.sleep(4000);
	var user = element(by.id('Simona'));
	expect(user.isPresent()).toBe(true);

});

it('should not join a non-existing session', function(){

	browser.get("http://localhost:8000/");
	var inputSession = element(by.id('sessionId'));
	inputSession.sendKeys('testing123');
	var joinSessionBtn = element(by.id('enterSession'));
	joinSessionBtn.click();
	var warning = element(by.id('warningSession')).isDisplayed();
	expect(warning).toBe(true);

});

it('should add an anonymous user on empty username input', function(){

	browser.get("http://localhost:8000/");
	var inputSession = element(by.id('sessionId'));
	inputSession.sendKeys('GjE5PYTLZa');
	var joinSessionBtn = element(by.id('enterSession'));
	joinSessionBtn.click();
	var input = element(by.id('username'));
	input.sendKeys('');
	var joinButton = element(by.id('joinSession'));
	joinButton.click();
	browser.sleep(4000);
	var user = element(by.id('Anonymous'));
	expect(user.isPresent()).toBe(true);

});

});<|endoftext|>


<commit_before>'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {

    browser.get('index.html');

    it('should automatically redirect to /shuffler when location hash/fragment is empty', function() {
        expect(browser.getLocationAbsUrl()).toMatch("/shuffler");
    });

    describe('shuffler', function() {

        beforeEach(function() {
            browser.get('index.html#/shuffler');
        });

        it('should render shuffler.html when user navigates to /shuffler', function() {
            expect(element.all(by.css('[ng-view] h1')).first().getText()).
            toMatch(/Shuffler/);
        });

        describe('cards', function () {
            var cards = element.all(by.repeater('card in deck'));

            it('should have 52 cards', function () {
                expect(cards.count()).toBe(52);
            });
        });

    });
});
<commit_msg>added tests for buttons<commit_after>'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {

    browser.get('index.html');

    it('should automatically redirect to /shuffler when location hash/fragment is empty', function() {
        expect(browser.getLocationAbsUrl()).toMatch("/shuffler");
    });

    describe('shuffler', function() {

        beforeEach(function() {
            browser.get('index.html#/shuffler');
        });

        it('should render shuffler.html when user navigates to /shuffler', function() {
            expect(element.all(by.css('[ng-view] h1')).first().getText()).
            toMatch(/Shuffler/);
        });

        describe('shuffle button', function () {
            var shuffleButton = element(by.id('shuffle-button'));
            expect(shuffleButton.isPresent()).toBe(true);
        });

        describe('sort button', function () {
            var sortButton = element(by.id('shuffle-button'));
            expect(sortButton.isPresent()).toBe(true);
        });

        describe('cards', function () {
            var cards = element.all(by.repeater('card in deck'));

            it('should have 52 cards', function () {
                expect(cards.count()).toBe(52);
            });

            it('should be ordered by clubs, diamonds, hearts, spades', function () {
                cards.all(by.css('.suit')).each(function (el, i) {
                    var suit = el.getAttribute('suit');

                    if (i < 13) expect(suit).toBe('clubs');

                    if (i > 12 && i < 26) expect(suit).toBe('diamonds');

                    if (i > 25 && i < 39) expect(suit).toBe('hearts');

                    if (i > 38) expect(suit).toBe('spades');
                });
            });
        });

    });
});
<|endoftext|>


<commit_before>SB.Examples.Monsters = function()
{
	SB.Game.call(this);

	this.helpScreen = null;
}

goog.inherits(SB.Examples.Monsters, SB.Game);

SB.Examples.Monsters.prototype.initialize = function(param)
{
	if (!param)
		param = {};

	if (!param.backgroundColor)
		param.backgroundColor = SB.Examples.Monsters.default_bgcolor;

	if (!param.displayStats)
		param.displayStats = SB.Examples.Monsters.default_display_stats;

	param.tabstop = true;

	SB.Game.prototype.initialize.call(this, param);

	SB.Graphics.instance.scene.add( new THREE.AmbientLight(0xffffff) ); //  0x505050 ) ); //

	this.initEntities();
}

SB.Examples.Monsters.prototype.initEntities = function()
{
	this.root = new SB.Entity;

	var grid = new SB.Grid({size: 14});
	this.root.addComponent(grid);

	var m1 = new SB.Examples.Monster();
	m1.transform.position.x = 5;

	var m2 = new SB.Examples.Monster();
	m2.transform.position.x = -5;

	var m3 = new SB.Examples.Monster();
	m3.transform.position.z = -5;

	this.monsters = [m1, m2, m3];
	this.activeMonster = null;

	var viewer = SB.Prefabs.WalkthroughController({ active : true, headlight : false });
	viewer.transform.position.set(0, 2.5, 3.67);

	this.root.addChild(m1);
	this.root.addChild(m2);
	this.root.addChild(m3);
	this.root.addChild(viewer);

	this.addEntity(this.root);

	this.root.realize();
}

SB.Examples.Monsters.prototype.onKeyDown = function(keyCode, charCode)
{
	if (this.activeMonster)
		this.activeMonster.onKeyDown(keyCode, charCode);
	else
		SB.Game.prototype.onKeyDown.call(this, keyCode, charCode)

}

SB.Examples.Monsters.prototype.onKeyUp = function(keyCode, charCode)
{
	var mi;

	var handled = false;
	switch (String.fromCharCode(keyCode))
	{
    	case 'H' :
    		this.help();
    		handled = true;
    		break;

    	case '1' :
    		mi = 1;
    		break;
    	case '2' :
    		mi = 2;
    		break;
    	case '3' :
    		mi = 3;
    		break;

    	default :
    		break;
	}

	if (!handled && this.activeMonster)
	{
		this.activeMonster.onKeyUp(keyCode, charCode);
	}

	if (mi)
	{
		var monster = this.monsters[mi-1];
		this.setActiveMonster(monster);
	}

	if (!handled)
		SB.Game.prototype.onKeyUp.call(this, keyCode, charCode)
}

SB.Examples.Monsters.prototype.onKeyPress = function(keyCode, charCode)
{
	SB.Game.prototype.onKeyPress.call(this, keyCode, charCode)
}

SB.Examples.Monsters.prototype.setActiveMonster = function(monster)
{
	if (this.activeMonster)
	{
		this.activeMonster.setActive(false);
	}

	monster.setActive(true);

	this.activeMonster = monster;
}

SB.Examples.Monsters.prototype.help = function()
{
	if (!this.helpScreen)
	{
		this.helpScreen = new SB.Examples.MonstersHelp();
	}

	this.helpScreen.show();
}

SB.Examples.Monsters.default_bgcolor = '#000000';
SB.Examples.Monsters.default_display_stats = true;
<commit_msg>Monsters now uses SB.AmbientLight<commit_after>SB.Examples.Monsters = function()
{
	SB.Game.call(this);

	this.helpScreen = null;
}

goog.inherits(SB.Examples.Monsters, SB.Game);

SB.Examples.Monsters.prototype.initialize = function(param)
{
	if (!param)
		param = {};

	if (!param.backgroundColor)
		param.backgroundColor = SB.Examples.Monsters.default_bgcolor;

	if (!param.displayStats)
		param.displayStats = SB.Examples.Monsters.default_display_stats;

	param.tabstop = true;

	SB.Game.prototype.initialize.call(this, param);

	this.initEntities();
}

SB.Examples.Monsters.prototype.initEntities = function()
{
	this.root = new SB.Entity;

	var ambientLight = new SB.Entity;
	var light = new SB.AmbientLight({color:0xFFFFFF});
	ambientLight.addComponent(light);

	this.root.addChild(ambientLight);

	var grid = new SB.Grid({size: 14});
	this.root.addComponent(grid);

	var m1 = new SB.Examples.Monster();
	m1.transform.position.x = 5;

	var m2 = new SB.Examples.Monster();
	m2.transform.position.x = -5;

	var m3 = new SB.Examples.Monster();
	m3.transform.position.z = -5;

	this.monsters = [m1, m2, m3];
	this.activeMonster = null;

	var viewer = SB.Prefabs.WalkthroughController({ active : true, headlight : false });
	viewer.transform.position.set(0, 2.5, 3.67);

	this.root.addChild(m1);
	this.root.addChild(m2);
	this.root.addChild(m3);
	this.root.addChild(viewer);

	this.addEntity(this.root);

	this.root.realize();
}

SB.Examples.Monsters.prototype.onKeyDown = function(keyCode, charCode)
{
	if (this.activeMonster)
		this.activeMonster.onKeyDown(keyCode, charCode);
	else
		SB.Game.prototype.onKeyDown.call(this, keyCode, charCode)

}

SB.Examples.Monsters.prototype.onKeyUp = function(keyCode, charCode)
{
	var mi;

	var handled = false;
	switch (String.fromCharCode(keyCode))
	{
    	case 'H' :
    		this.help();
    		handled = true;
    		break;

    	case '1' :
    		mi = 1;
    		break;
    	case '2' :
    		mi = 2;
    		break;
    	case '3' :
    		mi = 3;
    		break;

    	default :
    		break;
	}

	if (!handled && this.activeMonster)
	{
		this.activeMonster.onKeyUp(keyCode, charCode);
	}

	if (mi)
	{
		var monster = this.monsters[mi-1];
		this.setActiveMonster(monster);
	}

	if (!handled)
		SB.Game.prototype.onKeyUp.call(this, keyCode, charCode)
}

SB.Examples.Monsters.prototype.onKeyPress = function(keyCode, charCode)
{
	SB.Game.prototype.onKeyPress.call(this, keyCode, charCode)
}

SB.Examples.Monsters.prototype.setActiveMonster = function(monster)
{
	if (this.activeMonster)
	{
		this.activeMonster.setActive(false);
	}

	monster.setActive(true);

	this.activeMonster = monster;
}

SB.Examples.Monsters.prototype.help = function()
{
	if (!this.helpScreen)
	{
		this.helpScreen = new SB.Examples.MonstersHelp();
	}

	this.helpScreen.show();
}

SB.Examples.Monsters.default_bgcolor = '#000000';
SB.Examples.Monsters.default_display_stats = true;
<|endoftext|>


<commit_before>var topicPlayers= new Map();

module.exports = function(){

	return {

		getTopicPlayers: function(){
			return topicPlayers;
		},
		addPlayer: function(topicId,sessionId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(tempQueue==null)
			{
			 tempQueue=[];
			 topicPlayers.set(topicId,tempQueue);
			}
			tempQueue=topicPlayers.get(topicId);
			tempQueue.push(sessionId);
		},

		popPlayer: function(topicId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(!tempQueue)
			{
				return null;
			}
			var player=tempQueue[0];
			tempQueue.shift();
			if(tempQueue.length==0)
			{
				topicPlayers.delete(topicId);
			}
			return player;
		},

		countPlayers : function(topicId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(tempQueue==null)
			 return 0;

			return tempQueue.length;
		}
	}
};
<commit_msg>sockets added<commit_after>var topicPlayers= new Map();

module.exports = function(){

	return {

		getTopicPlayers: function(){
			return topicPlayers;
		},

		addPlayer: function(topicId,sessionId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(tempQueue==null)
			{
			 tempQueue=[];
			 topicPlayers.set(topicId,tempQueue);
			}
			tempQueue=topicPlayers.get(topicId);
			tempQueue.push(sessionId);
		},

		popPlayer: function(topicId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(!tempQueue)
			{
				return null;
			}
			var player=tempQueue[0];
			tempQueue.shift();
			if(tempQueue.length==0)
			{
				topicPlayers.delete(topicId);
			}
			return player;
		},

		countPlayers : function(topicId)
		{
			var tempQueue=topicPlayers.get(topicId);
			if(tempQueue==null)
			 return 0;

			return tempQueue.length;
		}
	}
};
<|endoftext|>


<commit_before>var Device = require('zetta-device');
var BridgeClient = require('./wemo-client/bridgeclient');

var util = require('util');

var WemoBulb = module.exports = function(device, bridge) {
  this.name = device.friendlyName;
  this.internalState = device.internalState;
  this.state = (device.internalState['10006'] === '1') ? 'on' : 'off';
  this.deviceId = device.deviceId;
  this._bridge = bridge;
  this._bridge.on('StatusChange', this.statusChange.bind(this));
  Device.call(this);
};
util.inherits(WemoBulb, Device);

WemoBulb.prototype.init = function(config) {
  config
    .type('wemo-bulb')
    .state(this.state)
    .name(this.name)
    .when('off', { allow: ['turn-on', 'dim'] })
    .when('on', { allow: ['turn-off', 'dim'] })
    .map('turn-on', this.turnOn)
    .map('turn-off', this.turnOff)
    .map('dim', this.dim, [
      { name: 'value', type: 'number'}
    ]);
    console.log(this);
};

WemoBulb.prototype.statusChange = function(event) {
  if (event.DeviceId === this.deviceId) {
    this.internalState[event.CapabilityId] = event.Value;
    console.log(event, this.deviceId, this.internalState);
    this.updateState();
  }
};

WemoBulb.prototype.updateState = function() {
  this.state = (this.internalState['10006'] === '1') ? 'on' : 'off';
};

WemoBulb.prototype.turnOn = function(cb) {
  // FIXME: This doesn't reset dim level
  this.setDeviceStatus(10006, '1:255');
  //this.state = 'on';
  cb();
};

WemoBulb.prototype.turnOff = function(cb) {
  this.setDeviceStatus(10006, '0');
  //this.state = 'off';
  cb();
};

WemoBulb.prototype.dim = function(value, cb) {
  this.setDeviceStatus(10008, (parseInt(value) || 0) + ':0');
  this.state = (value > 0) ? 'on' : 'off';
  cb();
};

WemoBulb.prototype.setDeviceStatus = function(capability, value) {
  this._bridge.setDeviceStatus(this.deviceId, capability, value);
}
<commit_msg>Update bulb states and dim value from events<commit_after>var Device = require('zetta-device');
var BridgeClient = require('./wemo-client/bridgeclient');

var util = require('util');

var WemoBulb = module.exports = function(device, bridge) {
  this.name = device.friendlyName;
  this._internalState = device.internalState;
  this.state = (device.internalState['10006'].substr(0,1) === '1') ? 'on' : 'off';
  this.brightness = device.internalState['10008'].split(':').shift();
  this.deviceId = device.deviceId;
  this._bridge = bridge;
  Device.call(this);
};
util.inherits(WemoBulb, Device);

WemoBulb.prototype.init = function(config) {
  config
    .type('wemo-bulb')
    .state(this.state)
    .monitor('brightness')
    .name(this.name)
    .when('off', { allow: ['turn-on', 'dim'] })
    .when('on', { allow: ['turn-off', 'dim'] })
    .map('turn-on', this.turnOn)
    .map('turn-off', this.turnOff)
    .map('dim', this.dim, [
      { name: 'value', type: 'number'}
    ]);

  var self = this;
  this._bridge.on('StatusChange', function(event){
    if (event.DeviceId === self.deviceId) {
      console.log('StatusChange event: %j', event);
      self._internalState[event.CapabilityId] = event.Value;
      self.brightness = self._internalState['10008'].split(':').shift();
      self.state = (self._internalState['10006'].substr(0,1) === '1') ? 'on' : 'off'
    }
  });
};

WemoBulb.prototype.turnOn = function(cb) {
  this.setDeviceStatus(10006, '1');
  this.state = 'on';
  cb();
};

WemoBulb.prototype.turnOff = function(cb) {
  this.setDeviceStatus(10006, '0');
  this.state = 'off';
  cb();
};

WemoBulb.prototype.dim = function(value, cb) {
  // value = brightness:transition time
  this.setDeviceStatus(10008, (parseInt(value) || 0) + ':25');
  this.state = (value > 0) ? 'on' : 'off';
  cb();
};

WemoBulb.prototype.setDeviceStatus = function(capability, value) {
  this._bridge.setDeviceStatus(this.deviceId, capability, value);
}
<|endoftext|>


<commit_before>'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {

  it('should automatically redirect to /view1 when location hash/fragment is empty', function() {
    browser.get('index.html');
    expect(browser.getLocationAbsUrl()).toMatch("/view1");
  });

  describe('view1', function() {

    beforeEach(function() {
      browser.get('index.html#!/view1');
    });

    it('should render view1 when user navigates to /view1', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 1/);
    });

  });

  describe('view2', function() {

    beforeEach(function() {
      browser.get('index.html#!/view2');
    });

    it('should render view2 when user navigates to /view2', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 2/);
    });

  });
});
<commit_msg>Fixed the tests<commit_after>'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {

  it('should automatically redirect to /classes when location hash/fragment is empty', function() {
    browser.get('index.html');
    expect(browser.getLocationAbsUrl()).toMatch("/classes");
  });

  describe('classes', function() {

    beforeEach(function() {
      browser.get('index.html/classes');
    });

    it('should render classes when user navigates to /classes', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for classes/);
    });

  });

  describe('view2', function() {

    beforeEach(function() {
      browser.get('index.html#!/view2');
    });

    it('should render view2 when user navigates to /view2', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 2/);
    });

  });
});
<|endoftext|>