123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962 |
- window.onload = function() {
- var ticketData = {
- "number": "72008",
- "title": "asdfasdf",
- "group_id": 1,
- "owner_id": 6,
- "updated_by_id": 6,
- "created_by_id": 6,
- "customer_id": 6,
- "state_id": 4,
- "priority_id": 2,
- "created_at": "2017-02-09T09:16:56.192Z",
- "updated_at": "2017-02-09T09:16:56.192Z",
- "pending_time": "2017-02-09T09:16:56.192Z",
- "aaaaa": "1234568791",
- "anrede": "Herr",
- "asdf": "",
- "organization_id": 6,
- "organization": {
- "name": "harald test gmbh",
- "domain": "www.harald-ist-cool.de",
- "shared": true,
- "note": "<div>harald test gmbh</div>",
- "member_ids": [
- 6,
- 2
- ],
- "active": true,
- "created_at": "2017-02-09T09:16:56.192Z",
- "updated_at": "2017-02-09T09:16:56.192Z",
- "domain_assignment": false,
- "updated_by_id": 6,
- "created_by_id": 6,
- "id": 6
- },
- "group": {
- "name": "Users",
- "assignment_timeout": null,
- "follow_up_possible": "reject",
- "follow_up_assignment": true,
- "email_address_id": 1,
- "signature_id": 1,
- "note": "Standard Group/Pool for Tickets.",
- "active": true,
- "updated_at": "2017-01-18T13:45:30.528Z",
- "id": 1
- },
- "owner": {
- "login": "-",
- "firstname": "-",
- "lastname": "",
- "email": "",
- "web": "",
- "password": "",
- "phone": "",
- "fax": "",
- "mobile": "",
- "street": "",
- "zip": "",
- "city": "",
- "country": "",
- "organization_id": null,
- "department": "",
- "note": "",
- "role_ids": [],
- "group_ids": [],
- "active": false,
- "updated_at": "2016-08-02T14:25:24.053Z",
- "address": "",
- "vip": false,
- "anrede": null,
- "asdf": null,
- "id": 1
- },
- "state": {
- "name": "closed",
- "note": null,
- "active": true,
- "id": 4
- },
- "priority": {
- "name": "2 normal",
- "note": null,
- "active": true,
- "updated_at": "2016-08-02T14:25:24.677Z",
- "id": 2
- },
- "article": {
- "from": "Test Master Agent",
- "to": "agent1@example.com",
- "cc": "agent1+cc@example.com",
- "body": "asdfasdfasdf<br><br><div data-signature=\"true\" data-signature-id=\"1\"> Test Master Agent<br><br>--<br> Super Support - Waterford Business Park<br> 5201 Blue Lagoon Drive - 8th Floor & 9th Floor - Miami, 33126 USA<br> Email: hot@example.com - Web: http://www.example.com/<br>--</div>",
- "content_type": "text/html",
- "ticket_id": "2",
- "type_id": 1,
- "sender_id": 1,
- "internal": false,
- "in_reply_to": "<20170217100622.2.152971@zammad.example.com>",
- "form_id": "326044216"
- },
- "customer": {
- "login": "hc@zammad.com",
- "firstname": "Harald",
- "lastname": "Customer",
- "email": "hc@zammad.com",
- "web": "zammad.com",
- "password": "",
- "phone": "1234567894",
- "fax": "",
- "mobile": "",
- "street": "",
- "zip": "",
- "city": "",
- "country": "",
- "organization_id": 6,
- "created_by_id": 6,
- "updated_by_id": 6,
- "department": "",
- "note": "",
- "role_ids": [
- 3
- ],
- "group_ids": [],
- "active": true,
- "created_at": "2017-02-09T09:16:56.192Z",
- "updated_at": "2017-02-09T09:16:56.192Z",
- "address": "Walter-Gropius-Straße 17, 80807 München, Germany",
- "web": "www.harald-ist-cool.de",
- "vip": false,
- "id": 434
- },
- "escalation_at": "2017-02-09T09:16:56.192Z",
- "last_contact_agent_at": "2017-02-09T09:16:56.192Z",
- "last_contact_agent_at": "2017-02-09T09:16:56.192Z",
- "last_contact_at": "2017-02-09T09:16:56.192Z",
- "last_contact_customer_at": "2017-02-09T09:16:56.192Z",
- "first_response_at": "2017-02-09T09:16:56.192Z",
- "close_at": "2017-02-09T09:16:56.192Z",
- "id": 8
- };
- var sessionData = {
- "login": "hh@zammad.com",
- "firstname": "Harald",
- "lastname": "Habebe",
- "email": "hh@zammad.com",
- "web": "",
- "password": "",
- "phone": "",
- "fax": "",
- "mobile": "",
- "street": "",
- "zip": "",
- "city": "",
- "country": "",
- "organization_id": 6,
- "department": "",
- "note": "",
- "role_ids": [
- 1,
- 2,
- 5,
- 6,
- 4
- ],
- "group_ids": [
- 1
- ],
- "active": true,
- "updated_at": "2017-02-09T09:17:04.770Z",
- "address": "",
- "vip": false,
- "anrede": "",
- "asdf": "",
- "id": 6
- };
- /*
- * ------------------------------------------------------------------------
- * Test functions
- * ------------------------------------------------------------------------
- */
- var testContains = function (key, value, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "contains",
- "value": value
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "contains not",
- "value": value
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- };
- var testIs = function (key, value, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "value": value
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "value": value
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- };
- var testPreConditionUser = function (key, specificValue, ticket, session) {
- App.Session.set(sessionData);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "current_user.id",
- "value": "",
- "value_completion": ""
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "current_user.id",
- "value": "",
- "value_completion": ""
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "not_set",
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "not_set",
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- };
- var testPreConditionOrganization = function (key, specificValue, ticket, session) {
- App.Session.set(sessionData);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "current_user.organization_id",
- "value": "",
- "value_completion": ""
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "current_user.organization_id",
- "value": "",
- "value_completion": ""
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "specific",
- "value": specificValue,
- "value_completion": "Nicole Braun <nicole.braun@zammad.org>"
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is",
- "pre_condition": "not_set",
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- setting = {
- "condition": {
- [key]: {
- "operator": "is not",
- "pre_condition": "not_set",
- }
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- };
- var testTime = function (key, value, ticket) {
- valueDate = new Date(value);
- compareDate = new Date( valueDate.setHours( valueDate.getHours() - 1 ) ).toISOString();
- setting = {
- "condition": {
- [key]: {
- "operator": "after (absolute)",
- "value": compareDate
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- valueDate = new Date(value);
- compareDate = new Date( valueDate.setHours( valueDate.getHours() + 1 ) ).toISOString();
- setting = {
- "condition": {
- [key]: {
- "operator": "after (absolute)",
- "value": compareDate
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- valueDate = new Date(value);
- compareDate = new Date( valueDate.setHours( valueDate.getHours() - 1 ) ).toISOString();
- setting = {
- "condition": {
- [key]: {
- "operator": "before (absolute)",
- "value": compareDate
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, false, result);
- valueDate = new Date(value);
- compareDate = new Date( valueDate.setHours( valueDate.getHours() + 1 ) ).toISOString();
- setting = {
- "condition": {
- [key]: {
- "operator": "before (absolute)",
- "value": compareDate
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- valueDate = new Date(value);
- compareDate = new Date( valueDate.setHours( valueDate.getHours() + 2 ) ).toISOString();
- setting = {
- "condition": {
- [key]: {
- "operator": "before (relative)",
- "value": 1,
- "range": "hour"
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, true, result);
- };
- var testTimeBeforeRelative = function (key, value, range, expectedResult, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "before (relative)",
- "value": value,
- "range": range
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, expectedResult, result);
- };
- var testTimeAfterRelative = function (key, value, range, expectedResult, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "after (relative)",
- "value": value,
- "range": range
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, expectedResult, result);
- };
- var testTimeWithinNextRelative = function (key, value, range, expectedResult, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "within next (relative)",
- "value": value,
- "range": range
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, expectedResult, result);
- };
- var testTimeWithinLastRelative = function (key, value, range, expectedResult, ticket) {
- setting = {
- "condition": {
- [key]: {
- "operator": "within last (relative)",
- "value": value,
- "range": range
- },
- }
- };
- result = App.Ticket.selector(ticket, setting['condition'] );
- equal(result, expectedResult, result);
- };
- /*
- * ------------------------------------------------------------------------
- * Field tests
- * ------------------------------------------------------------------------
- */
- test("ticket number", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('ticket.number', '72', ticket);
- });
- test("ticket title", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('ticket.title', 'asd', ticket);
- });
- test("ticket customer_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- App.Session.set(sessionData);
- testPreConditionUser('ticket.customer_id', '6', ticket, sessionData);
- });
- test("ticket organization_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('ticket.organization_id', '6', ticket, sessionData);
- });
- test("ticket group_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('ticket.group_id', ['1'], ticket, sessionData);
- });
- test("ticket owner_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- App.Session.set(sessionData);
- testPreConditionUser('ticket.owner_id', '6', ticket, sessionData);
- });
- test("ticket state_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('ticket.state_id', ['4'], ticket, sessionData);
- });
- test("ticket pending_time", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.pending_time', ticket.pending_time, ticket);
- // -------------------------
- // BEFORE TIME
- // -------------------------
- // hour
- ticket.pending_time = new Date().toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'hour', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() - 60 * 60 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'hour', true, ticket);
- // day
- ticket.pending_time = new Date().toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'day', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() - 60 * 60 * 48 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'day', true, ticket);
- // year
- ticket.pending_time = new Date().toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'year', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() - 60 * 60 * 365 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeBeforeRelative('ticket.pending_time', 1, 'year', true, ticket);
- // -------------------------
- // AFTER TIME
- // -------------------------
- // hour
- ticket.pending_time = new Date().toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'hour', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() + 60 * 60 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'hour', true, ticket);
- // day
- ticket.pending_time = new Date().toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'day', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() + 60 * 60 * 48 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'day', true, ticket);
- // year
- ticket.pending_time = new Date().toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'year', false, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() + 60 * 60 * 365 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeAfterRelative('ticket.pending_time', 1, 'year', true, ticket);
- // -------------------------
- // WITHIN LAST TIME
- // -------------------------
- // hour
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() - 60 * 60 * 0.5 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeWithinLastRelative('ticket.pending_time', 1, 'hour', true, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() - 60 * 60 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeWithinLastRelative('ticket.pending_time', 1, 'hour', false, ticket);
- // -------------------------
- // WITHIN NEXT TIME
- // -------------------------
- // hour
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() + 60 * 60 * 0.5 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeWithinNextRelative('ticket.pending_time', 1, 'hour', true, ticket);
- compareDate = new Date();
- compareDate.setTime( compareDate.getTime() + 60 * 60 * 2 * 1000 );
- ticket.pending_time = compareDate.toISOString();
- testTimeWithinNextRelative('ticket.pending_time', 1, 'hour', false, ticket);
- });
- test("ticket priority_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('ticket.priority_id', ['2'], ticket, sessionData);
- });
- test("ticket escalation_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.escalation_at', ticket.escalation_at, ticket);
- });
- test("ticket last_contact_agent_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.last_contact_agent_at', ticket.last_contact_agent_at, ticket);
- });
- test("ticket last_contact_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.last_contact_at', ticket.last_contact_at, ticket);
- });
- test("ticket last_contact_customer_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.last_contact_customer_at', ticket.last_contact_customer_at, ticket);
- });
- test("ticket first_response_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.first_response_at', ticket.first_response_at, ticket);
- });
- test("ticket close_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.close_at', ticket.close_at, ticket);
- });
- test("ticket created_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- App.Session.set(sessionData);
- testPreConditionUser('ticket.created_by_id', '6', ticket, sessionData);
- });
- test("ticket created_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.created_at', ticket.created_at, ticket);
- });
- test("ticket updated_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('ticket.updated_at', ticket.updated_at, ticket);
- });
- test("ticket updated_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- App.Session.set(sessionData);
- testPreConditionUser('ticket.updated_by_id', '6', ticket, sessionData);
- });
- test("article from", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('article.from', 'Master', ticket);
- });
- test("article to", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('article.to', 'agent1', ticket);
- });
- test("article cc", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('article.cc', 'agent1+cc', ticket);
- });
- test("article subject", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('article.subject', 'asdf', ticket);
- });
- test("article type_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('article.type_id', ['1'], ticket);
- });
- test("article sender_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('article.sender_id', ['1'], ticket);
- });
- test("article internal", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('article.internal', ['false'], ticket);
- });
- test("article created_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('article.created_by_id', '6', ticket, sessionData);
- });
- test("customer login", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.login', 'hc', ticket);
- });
- test("customer firstname", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.firstname', 'Harald', ticket);
- });
- test("customer lastname", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.lastname', 'Customer', ticket);
- });
- test("customer email", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.email', 'hc', ticket);
- });
- test("customer organization_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionOrganization('customer.organization_id', '6', ticket, sessionData);
- });
- test("customer created_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('customer.created_by_id', '6', ticket, sessionData);
- });
- test("customer created_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('customer.created_at', ticket.customer.created_at, ticket);
- });
- test("customer updated_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('customer.updated_by_id', '6', ticket, sessionData);
- });
- test("customer missing_field", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.missing_field', '', ticket);
- });
- test("customer web", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('customer.web', 'cool', ticket);
- });
- test("organization name", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('organization.name', 'gmbh', ticket);
- });
- test("organization shared", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('organization.shared', true, ticket);
- });
- test("organization created_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('organization.created_by_id', 6, ticket);
- });
- test("organization updated_by_id", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testPreConditionUser('organization.updated_by_id', 6, ticket);
- });
- test("organization created_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('organization.created_at', ticket.organization.created_at, ticket);
- });
- test("organization updated_at", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testTime('organization.updated_at', ticket.organization.updated_at, ticket);
- });
- test("organization domain_assignment", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testIs('organization.domain_assignment', false, ticket);
- });
- test("organization domain", function() {
- ticket = new App.Ticket();
- ticket.load(ticketData);
- testContains('organization.domain', 'cool', ticket);
- });
- }
|