summaryrefslogtreecommitdiffstats
path: root/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml
blob: 76de34396e50b3ac3fe2bea269964b69e85a4146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/

import QtQuick 2.0
import QtTest 1.0
import QtOrganizer 5.0

TestCase {
    name: "ItemDetailTests"
    id: organizerItemDetailTests
    property int waitTime : 200

    QOrganizerTestUtility {
        id: utility
    }

    EventTime {
        id: eventTime
    }

    Comment {
        id: comment
    }

    Description {
        id: description
    }

    DisplayLabel {
        id: displayLabel
    }

    Guid {
        id: guid
    }

    Location {
        id: location
    }

    Parent {
        id: parent
    }

    Priority {
        id: priority
    }

    Tag {
        id: tag
    }

    Timestamp {//id "timestamp" conflict something
        id: timestamp1
    }

    Type {
        id: type
    }

    JournalTime {
        id: journalTime
    }

    TodoProgress {
        id: todoProgress
    }

    TodoTime {
        id: todoTime
    }

    Reminder {
        id: reminder
    }

    AudibleReminder {
        id: audibleReminder
    }

    EmailReminder {
        id: emailReminder
    }

    VisualReminder {
        id: visualReminder
    }

    Recurrence {
        id: recurrence
    }

    ExtendedDetail {
        id: extendedDetail
    }

    EventAttendee {
        id: eventAttendee
    }

    EventRsvp {
        id: eventRsvp
    }

    Classification {
        id: classification
    }

    Version {
        id: version
    }

    function test_version() {
        compare(version.type, Detail.Version)

        compare(version.version, 0)
        compare(version.value(Version.FieldVersion), undefined)
        version.version = 64
        compare(version.version, 64)
        compare(version.value(Version.FieldVersion), 64)

        compare(version.extendedVersion, "")
        compare(version.value(Version.FieldExtendedVersion), undefined)
        version.extendedVersion = "Qt rules"
        compare(version.extendedVersion, "Qt rules")
        compare(version.value(Version.FieldExtendedVersion), "Qt rules")
    }

    function test_extendedDetail() {
        compare(extendedDetail.type, Detail.ExtendedDetail)

        compare(extendedDetail.name, "")
        compare(extendedDetail.value(ExtendedDetail.FieldName), undefined)
        extendedDetail.name = "Qt"
        compare(extendedDetail.name, "Qt")
        compare(extendedDetail.value(ExtendedDetail.FieldName), "Qt")

        compare(extendedDetail.data, undefined)
        compare(extendedDetail.value(ExtendedDetail.FieldData), undefined)
        extendedDetail.data = "Everywhere"
        compare(extendedDetail.data, "Everywhere");
        compare(extendedDetail.value(ExtendedDetail.FieldData), "Everywhere")
    }

    function test_recurrence() {
    }

    function test_recurrenceDateArrays_data() {
        return [
            {tag: "basic date object", testValue: [new Date(2012, 2, 16, 11, 00, 00)]},
            {tag: "date object from string", testValue: [new Date("January 1, 1986")], expectedValue: ['1986-01-01']},
            {tag: "date object from ISO date", testValue: [new Date('2014-01-01')]},
            {tag: "datetime object from string", testValue: [new Date("October 13, 1975 11:13:00")]},
            {tag: "date string at year boundary lower", testValue: ['2013-01-01']},
            {tag: "date string at year boundary upper", testValue: ['2013-12-31']},
            {tag: "datetime string", testValue: ['2013-10-23T23:55:00']},
            {tag: "datetime string ISO 8601   Z", testValue: ['1997-07-16T19:20:30.45Z']},
            {tag: "datetime string ISO 8601 +01", testValue: ['1997-07-16T19:20:30.45+01:00']},
            {tag: "datetime string ISO 8601 +10", testValue: ['1997-07-16T19:20:30.45+10:00']},
            {tag: "datetime string ISO 8601 -01", testValue: ['1997-07-16T19:20:30.45-01:00']},
            {tag: "datetime string ISO 8601 -10", testValue: ['1997-07-16T19:20:30.45-10:00']},
            {tag: "datetime string ISO 8601 +10 at boundary", testValue: ['1997-01-01T00:00:01.45+10:00']},
            {tag: "datetime string ISO 8601 -10 at boundary", testValue: ['1997-12-31T23:59:59.45-10:00']}
        ]
    }
    function test_recurrenceDateArrays(data) {

        console.log()//print the separate cases
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempRecurrence = utility.create_testobject("import QtOrganizer 5.0; Recurrence{}", organizerItemDetailTests)
        detailChangedSpy.target = tempRecurrence;
        detailChangedSpy.signalName = "detailChanged"

        var testDate = (typeof data.testValue[0] == 'string') ? new Date(data.testValue[0]) : data.testValue[0];
        var expectedDate = (data.hasOwnProperty('expectedValue') && typeof data.expectedValue[0] == 'string') ? new Date(data.expectedValue[0]) : testDate;
        var testDateUTCMidnight = utility.toUTCMidnight(expectedDate);

        if (isNaN(testDate.getTime())) {
            warn("test \"" + data.tag + "\" contains incorrect date");
            return;
        }

        // recurrenceDates
        tempRecurrence.recurrenceDates = data.testValue
        detailChangedSpy.wait(waitTime)
        compare(tempRecurrence.recurrenceDates[0], testDateUTCMidnight)
        var rdates = tempRecurrence.value(Recurrence.FieldRecurrenceDates);
        compare(rdates[0], testDateUTCMidnight);
        compare(detailChangedSpy.count, 1)

        // exceptionDates
        tempRecurrence.setValue(Recurrence.FieldExceptionDates, data.testValue)
        detailChangedSpy.wait(waitTime)
        compare(tempRecurrence.exceptionDates[0], testDateUTCMidnight)
        var edates = tempRecurrence.value(Recurrence.FieldExceptionDates);
        compare(edates[0], testDateUTCMidnight);
        compare(detailChangedSpy.count, 2)
    }


    function test_visualReminder() {
        compare(visualReminder.type, Detail.VisualReminder)
        compare(visualReminder.reminderType, Reminder.VisualReminder)

        compare(visualReminder.repetitionCount, 0)
        compare(visualReminder.value(VisualReminder.FieldRepetitionCount), undefined)
        compare(visualReminder.repetitionDelay, 0)
        compare(visualReminder.value(VisualReminder.FieldRepetitionDelay), undefined)
        compare(visualReminder.secondsBeforeStart, 0)
        compare(visualReminder.value(VisualReminder.FieldSecondsBeforeStart), undefined)
        compare(visualReminder.message, "")
        compare(visualReminder.value(VisualReminder.FieldMessage), undefined)
        compare(visualReminder.dataUrl, "")
        compare(visualReminder.value(VisualReminder.FieldDataUrl), undefined)

        visualReminder.repetitionCount = 19
        compare(visualReminder.repetitionCount, 19)
        compare(visualReminder.value(VisualReminder.FieldRepetitionCount), 19)

        visualReminder.repetitionDelay = 89
        compare(visualReminder.repetitionDelay, 89)
        compare(visualReminder.value(VisualReminder.FieldRepetitionDelay), 89)

        visualReminder.secondsBeforeStart = 64
        compare(visualReminder.secondsBeforeStart, 64)
        compare(visualReminder.value(VisualReminder.FieldSecondsBeforeStart), 64)

        visualReminder.message = "Qt Open Governance"
        compare(visualReminder.message, "Qt Open Governance")
        compare(visualReminder.value(VisualReminder.FieldMessage), "Qt Open Governance")

        visualReminder.dataUrl = "http://qt-project.org/"
        compare(visualReminder.dataUrl, "http://qt-project.org/")
        compare(visualReminder.value(VisualReminder.FieldDataUrl), "http://qt-project.org/")
    }

    function test_emailReminder() {
        compare(emailReminder.type, Detail.EmailReminder)
        compare(emailReminder.reminderType, Reminder.EmailReminder)

        compare(emailReminder.repetitionCount, 0)
        compare(emailReminder.value(EmailReminder.FieldRepetitionCount), undefined)
        compare(emailReminder.repetitionDelay, 0)
        compare(emailReminder.value(EmailReminder.FieldRepetitionDelay), undefined)
        compare(emailReminder.secondsBeforeStart, 0)
        compare(emailReminder.value(EmailReminder.FieldSecondsBeforeStart), undefined)
        compare(emailReminder.body, "")
        compare(emailReminder.value(EmailReminder.FieldBody), undefined)
        compare(emailReminder.subject, "")
        compare(emailReminder.value(EmailReminder.FieldSubject), undefined)
        compare(emailReminder.recipients.length, 0)
        compare(emailReminder.value(EmailReminder.FieldRecipients), undefined)
        compare(emailReminder.attachments. length, 0)
        compare(emailReminder.value(EmailReminder.FieldAttachments), undefined)

        emailReminder.repetitionCount = 19
        compare(emailReminder.repetitionCount, 19)
        compare(emailReminder.value(EmailReminder.FieldRepetitionCount), 19)

        emailReminder.repetitionDelay = 89
        compare(emailReminder.repetitionDelay, 89)
        compare(emailReminder.value(EmailReminder.FieldRepetitionDelay), 89)

        emailReminder.secondsBeforeStart = 64
        compare(emailReminder.secondsBeforeStart, 64)
        compare(emailReminder.value(EmailReminder.FieldSecondsBeforeStart), 64)

        emailReminder.body = "Qt - Cross-platform application and UI framework"
        compare(emailReminder.body, "Qt - Cross-platform application and UI framework")
        compare(emailReminder.value(EmailReminder.FieldBody), "Qt - Cross-platform application and UI framework")

        emailReminder.subject = "Qt!"
        compare(emailReminder.subject, "Qt!")
        compare(emailReminder.value(EmailReminder.FieldSubject), "Qt!")

        emailReminder.recipients = ["Berlin", "Brisbane", "Oslo", "Tampere"]
        compare(emailReminder.recipients, ["Berlin", "Brisbane", "Oslo", "Tampere"])
        compare(emailReminder.value(EmailReminder.FieldRecipients), ["Berlin", "Brisbane", "Oslo", "Tampere"])

        emailReminder.attachments = [1, 2, "345"]
        compare(emailReminder.attachments, [1, 2, "345"])
        compare(emailReminder.value(EmailReminder.FieldAttachments), [1, 2, "345"])
    }

    function test_audibleReminder() {
        compare(audibleReminder.type, Detail.AudibleReminder)
        compare(audibleReminder.reminderType, Reminder.AudibleReminder)

        compare(audibleReminder.repetitionCount, 0)
        compare(audibleReminder.value(AudibleReminder.FieldRepetitionCount), undefined)
        compare(audibleReminder.repetitionDelay, 0)
        compare(audibleReminder.value(AudibleReminder.FieldRepetitionDelay), undefined)
        compare(audibleReminder.secondsBeforeStart, 0)
        compare(audibleReminder.value(AudibleReminder.FieldSecondsBeforeStart), undefined)
        compare(audibleReminder.dataUrl, "")
        compare(audibleReminder.value(AudibleReminder.FieldDataUrl), undefined)

        audibleReminder.repetitionCount = 19
        compare(audibleReminder.repetitionCount, 19)
        compare(audibleReminder.value(AudibleReminder.FieldRepetitionCount), 19)

        audibleReminder.repetitionDelay = 89
        compare(audibleReminder.repetitionDelay, 89)
        compare(audibleReminder.value(AudibleReminder.FieldRepetitionDelay), 89)

        audibleReminder.secondsBeforeStart = 64
        compare(audibleReminder.secondsBeforeStart, 64)
        compare(audibleReminder.value(AudibleReminder.FieldSecondsBeforeStart), 64)

        audibleReminder.dataUrl = "http://qt-project.org/"
        compare(audibleReminder.dataUrl, "http://qt-project.org/")
        compare(audibleReminder.value(AudibleReminder.FieldDataUrl), "http://qt-project.org/")
    }

    function test_reminder() {
        compare(reminder.type, Detail.Reminder)
        compare(reminder.reminderType, Reminder.NoReminder)

        compare(reminder.repetitionCount, 0)
        compare(reminder.value(Reminder.FieldRepetitionCount), undefined)
        compare(reminder.repetitionDelay, 0)
        compare(reminder.value(Reminder.FieldRepetitionDelay), undefined)
        compare(reminder.secondsBeforeStart, 0)
        compare(reminder.value(Reminder.FieldSecondsBeforeStart), undefined)

        reminder.repetitionCount = 19
        compare(reminder.repetitionCount, 19)
        compare(reminder.value(Reminder.FieldRepetitionCount), 19)

        reminder.repetitionDelay = 89
        compare(reminder.repetitionDelay, 89)
        compare(reminder.value(Reminder.FieldRepetitionDelay), 89)

        reminder.secondsBeforeStart = 64
        compare(reminder.secondsBeforeStart, 64)
        compare(reminder.value(Reminder.FieldSecondsBeforeStart), 64)
    }

    function test_todoTime() {
        compare(todoTime.type, Detail.TodoTime)

        compare(todoTime.allDay, false)
        compare(todoTime.value(TodoTime.FieldAllDay), undefined)
        todoTime.allDay = true
        compare(todoTime.allDay, true)
        compare(todoTime.value(TodoTime.FieldAllDay), true)

        compare(todoTime.value(TodoTime.FieldStartDateTime), undefined)
        var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
        todoTime.startDateTime = startDateTime
        compare(todoTime.startDateTime, startDateTime)
        compare(todoTime.value(TodoTime.FieldStartDateTime), startDateTime)

        compare(todoTime.value(TodoTime.FieldDueDateTime), undefined)
        var dueDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
        todoTime.dueDateTime = dueDateTime
        compare(todoTime.dueDateTime, dueDateTime)
        compare(todoTime.value(TodoTime.FieldDueDateTime), dueDateTime)
    }

    function test_todoProgress() {
        compare(todoProgress.type, Detail.TodoProgress)

        compare(todoProgress.value(TodoProgress.FieldFinishedDateTime), undefined)
        var finishedDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
        todoProgress.finishedDateTime = finishedDateTime
        compare(todoProgress.finishedDateTime, finishedDateTime)
        compare(todoProgress.value(TodoProgress.FieldFinishedDateTime), finishedDateTime)

        compare(todoProgress.value(TodoProgress.FieldPercentageComplete), undefined)
        todoProgress.percentageComplete = 64
        compare(todoProgress.percentageComplete, 64)
        compare(todoProgress.value(TodoProgress.FieldPercentageComplete), 64)

        compare(todoProgress.value(TodoProgress.FieldStatus), undefined)
        todoProgress.status = TodoProgress.InProgress
        compare(todoProgress.status, TodoProgress.InProgress)
        compare(todoProgress.value(TodoProgress.FieldStatus), TodoProgress.InProgress)
    }

    function test_journalTime() {
        compare(journalTime.type, Detail.JournalTime)

        compare(journalTime.value(JournalTime.FieldEntryDateTime), undefined)
        var entryDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
        journalTime.entryDateTime = entryDateTime
        compare(journalTime.entryDateTime, entryDateTime)
        compare(journalTime.value(JournalTime.FieldEntryDateTime), journalTime.entryDateTime)
    }

    function test_type() {
        compare(type.type, Detail.ItemType)

        compare(type.value(Type.FieldType), undefined)
        type.itemType = Type.TodoOccurrence
        compare(type.itemType, Type.TodoOccurrence)
    }

    function test_timestamp() {
        compare(timestamp1.type, Detail.Timestamp)

        compare(timestamp1.value(Timestamp.FieldCreated), undefined)
        var timestamp = new Date("1991-08-25 20:57:08 GMT+0000")
        timestamp.created = timestamp
        compare(timestamp.created, timestamp)

        compare(timestamp1.value(Timestamp.FieldLastModified), undefined)
        var lastModified = new Date("1995-05-20 11:22:33 GMT+0200")
        timestamp.lastModified = lastModified
        compare(timestamp.lastModified, lastModified)
    }

    function test_tag() {
        compare(tag.type, Detail.Tag)

        compare(tag.value(Tag.FieldTag), undefined)
        tag.tag = "Qt"
        compare(tag.tag, "Qt")
        compare(tag.value(Tag.FieldTag), "Qt")
    }

    function test_priority() {
        compare(priority.type, Detail.Priority)

        compare(priority.value(Priority.FieldPriority), undefined)
        priority.priority = Priority.Medium
        compare(priority.priority, Priority.Medium)
        compare(priority.value(Priority.FieldPriority), Priority.Medium)
    }

    function test_parent() {
        compare(parent.type, Detail.Parent)

        compare(parent.value(Parent.FieldOriginalDate), undefined)
        var originalDate = new Date("2008-12-28")
        parent.originalDate = originalDate
        compare(parent.originalDate, originalDate)
        compare(parent.value(Parent.FieldOriginalDate), originalDate)

        var originalDate2 = new Date("2008-01-01")
        var originalDate2UTC = utility.toUTCMidnight(originalDate2)
        parent.setValue(Parent.FieldOriginalDate, originalDate2)
        compare(parent.originalDate, originalDate2UTC)
        compare(parent.value(Parent.FieldOriginalDate), originalDate2UTC)

        parent.setValue(Parent.FieldOriginalDate, "2008-01-01")
        compare(parent.originalDate, originalDate2UTC)
        compare(parent.value(Parent.FieldOriginalDate), originalDate2UTC)

        var originalDate3 = new Date("January 1, 2008")
        parent.setValue(Parent.FieldOriginalDate, originalDate3)
        compare(parent.originalDate, originalDate2UTC)
        compare(parent.value(Parent.FieldOriginalDate), originalDate2UTC)
    }

    function test_location() {
        compare(location.type, Detail.Location)

        compare(location.value(Location.FieldLatitude), undefined)
        location.latitude = 1.2
        compare(location.latitude, 1.2)
        compare(location.value(Location.FieldLatitude), 1.2)

        compare(location.value(Location.FieldLongitude), undefined)
        location.longitude = 3.4
        compare(location.longitude, 3.4)
        compare(location.value(Location.FieldLongitude), 3.4)

        compare(location.value(Location.FieldLabel), undefined)
        location.label = "Zion"
        compare(location.label, "Zion")
        compare(location.value(Location.FieldLabel), "Zion")
    }

    function test_guid() {
        compare(guid.type, Detail.Guid)

        compare(guid.value(Guid.FieldGuid), undefined)
        guid.guid = "b7dd2d61-fcb3-1170-e314-899ac5e91c7c"
        compare(guid.guid, "b7dd2d61-fcb3-1170-e314-899ac5e91c7c")
        compare(guid.value(Guid.FieldGuid), "b7dd2d61-fcb3-1170-e314-899ac5e91c7c")
    }

    function test_displayLabel() {
        compare(displayLabel.type, Detail.DisplayLabel)

        compare(displayLabel.value(DisplayLabel.FieldLabel), undefined)
        displayLabel.label = "Deploy Everywhere"
        compare(displayLabel.label, "Deploy Everywhere")
        compare(displayLabel.value(DisplayLabel.FieldLabel), "Deploy Everywhere")
    }

    function test_description() {
        compare(description.type, Detail.Description)

        compare(description.value(Description.FieldDescription), undefined)
        description.description = "Create More"
        compare(description.description, "Create More")
        compare(description.value(Description.FieldDescription), "Create More")
    }

    function test_comment() {
        compare(comment.type, Detail.Comment)

        compare(comment.value(Comment.FieldComment), undefined)
        comment.comment = "Code Less"
        compare(comment.comment, "Code Less")
        compare(comment.value(Comment.FieldComment), "Code Less")
    }

    function test_eventTime() {
        compare(eventTime.type, Detail.EventTime)

        compare(eventTime.value(EventTime.FieldAllDay), undefined)
        eventTime.allDay = true
        compare(eventTime.allDay, true)
        compare(eventTime.value(EventTime.FieldAllDay), true)

        compare(eventTime.value(EventTime.FieldStartDateTime), undefined)
        var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
        eventTime.startDateTime = startDateTime
        compare(eventTime.startDateTime, startDateTime)
        compare(eventTime.value(EventTime.FieldStartDateTime), startDateTime)

        compare(eventTime.value(EventTime.FieldEndDateTime), undefined)
        var endDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
        eventTime.endDateTime = endDateTime
        compare(eventTime.endDateTime, endDateTime)
        compare(eventTime.value(EventTime.FieldEndDateTime), endDateTime)
    }

    function test_attendeeDetail() {
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;"
                 + "SignalSpy {}"
                 , organizerItemDetailTests);
        detailChangedSpy.target = eventAttendee;
        detailChangedSpy.signalName = "detailChanged";
        var count = 0;

        compare(eventAttendee.type, Detail.EventAttendee)
        eventAttendee.name = "new attendee"
        detailChangedSpy.wait(waitTime)
        compare(eventAttendee.name, "new attendee")
        compare(detailChangedSpy.count, ++count)

        eventAttendee.emailAddress = "new.attendee@qt.com"
        detailChangedSpy.wait(waitTime)
        compare(eventAttendee.emailAddress, "new.attendee@qt.com")
        compare(detailChangedSpy.count, ++count)

        eventAttendee.attendeeId = "123444455555"
        detailChangedSpy.wait(waitTime)
        compare(eventAttendee.attendeeId, "123444455555")
        compare(detailChangedSpy.count, ++count)

        eventAttendee.participationStatus = EventAttendee.StatusAccepted
        detailChangedSpy.wait(waitTime)
        compare(eventAttendee.participationStatus, EventAttendee.StatusAccepted)
        compare(detailChangedSpy.count, ++count)

        eventAttendee.participationRole = EventAttendee.RoleRequiredParticipant
        detailChangedSpy.wait(waitTime)
        compare(eventAttendee.participationRole, EventAttendee.RoleRequiredParticipant)
        compare(detailChangedSpy.count, ++count)

        // set same value
        eventAttendee.participationRole = EventAttendee.RoleRequiredParticipant
        compare(eventAttendee.participationRole, EventAttendee.RoleRequiredParticipant)
        // no signal has been emited
        compare(detailChangedSpy.count, count)
    }

    function test_rsvpGeneralTesting() {
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;"
                 + "SignalSpy {}"
                 , organizerItemDetailTests);
        detailChangedSpy.target = eventRsvp;
        detailChangedSpy.signalName = "detailChanged";
        var count = 0;

        compare(eventRsvp.type, Detail.EventRsvp)

        // default value checks
        compare(eventRsvp.organizerName, "")
        compare(eventRsvp.organizerEmail, "")
        compare(eventRsvp.participationStatus, EventAttendee.StatusUnknown)
        compare(eventRsvp.participationRole, EventAttendee.RoleUnknown)
        compare(eventRsvp.responseRequirement, EventRsvp.ResponseNotRequired)

        // no change tests are here to minimize the delays of testing
        // organizerName - no change on value
        eventRsvp.organizerName = eventRsvp.organizerName
        compare(eventRsvp.organizerName, eventRsvp.organizerName)
        compare(detailChangedSpy.count, count)
        // organizerEmail - no change on value
        eventRsvp.organizerEmail = eventRsvp.organizerEmail
        compare(eventRsvp.organizerEmail, eventRsvp.organizerEmail)
        compare(detailChangedSpy.count, count)
        // participationStatus - no change on value
        eventRsvp.participationStatus = eventRsvp.participationStatus
        compare(eventRsvp.participationStatus, eventRsvp.participationStatus)
        compare(detailChangedSpy.count, count)
        // participationRole - no change on value
        eventRsvp.participationRole = eventRsvp.participationRole
        compare(eventRsvp.participationRole, eventRsvp.participationRole)
        compare(detailChangedSpy.count, count)
        // responseRequirement - no change on value
        eventRsvp.responseRequirement = eventRsvp.responseRequirement
        compare(eventRsvp.responseRequirement, eventRsvp.responseRequirement)
        compare(detailChangedSpy.count, count)
    }

    function test_rsvpStringProperties_data() {
        return [
            {tag: "string", testValue: "short string"},
            {tag: "long string", testValue: "here goes the long string name but what to have here? Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed posuere interdum sem. Quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. Mauris varius diam vitae arcu. Sed arcu lectus auctor vitae, consectetuer et venenatis eget velit. Sed augue orci, lacinia eu tincidunt et eleifend nec lacus. Donec ultricies nisl ut felis, suspendisse potenti. Lorem ipsum ligula ut hendrerit mollis, ipsum erat vehicula risus, eu suscipit sem libero nec erat. Aliquam erat volutpat. Sed congue augue vitae neque. Nulla consectetuer porttitor pede. Fusce purus morbi tortor magna condimentum vel, placerat id blandit sit amet tortor. Mauris sed libero. Suspendisse facilisis nulla in lacinia laoreet, lorem velit accumsan velit vel mattis libero nisl et sem. Proin interdum maecenas massa turpis sagittis in, interdum non lobortis vitae massa. Quisque purus lectus, posuere eget imperdiet nec sodales id arcu. Vestibulum elit pede dictum eu, viverra non tincidunt eu ligula. Nam molestie nec tortor. Donec placerat leo sit amet velit. Vestibulum id justo ut vitae massa. Proin in dolor mauris consequat aliquam. Donec ipsum, vestibulum ullamcorper venenatis augue. Aliquam tempus nisi in auctor vulputate, erat felis pellentesque augue nec, pellentesque lectus justo nec erat. Aliquam et nisl. Quisque sit amet dolor in justo pretium condimentum. Vivamus placerat lacus vel vehicula scelerisque, dui enim adipiscing lacus sit amet sagittis, libero enim vitae mi. In neque magna posuere, euismod ac tincidunt tempor est. Ut suscipit nisi eu purus. Proin ut pede mauris eget ipsum. Integer vel quam nunc commodo consequat. Integer ac eros eu tellus dignissim viverra. Maecenas erat aliquam erat volutpat. Ut venenatis ipsum quis turpis. Integer cursus scelerisque lorem. Sed nec mauris id quam blandit consequat. Cras nibh mi hendrerit vitae, dapibus et aliquam et magna. Nulla vitae elit. Mauris consectetuer odio vitae augue."},
            {tag: "number", testValue: 123},
        ]
    }
    function test_rsvpStringProperties(data) {
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempEventRsvp = utility.create_testobject("import QtOrganizer 5.0; EventRsvp{}", organizerItemDetailTests)
        detailChangedSpy.target = tempEventRsvp
        detailChangedSpy.signalName = "detailChanged"

        // organizerName
        tempEventRsvp.organizerName = data.testValue
        detailChangedSpy.wait(waitTime)
        compare(tempEventRsvp.organizerName, data.testValue.toString())
        compare(detailChangedSpy.count, 1)

        // organizerEmail
        tempEventRsvp.organizerEmail = data.testValue
        detailChangedSpy.wait(waitTime)
        compare(tempEventRsvp.organizerEmail, data.testValue.toString())
        compare(detailChangedSpy.count, 2)
    }

    function test_rsvpDateProperties_data() {
        return [
            {tag: "basic date object", testValue: new Date(2012, 2, 16, 11, 00, 00)},
            {tag: "date object from string", testValue: new Date("January 1, 1986"), expectedValue: '1986-01-01'},
            {tag: "date object from ISO date", testValue: new Date('2014-01-01')},
            {tag: "datetime object from string", testValue: new Date("October 13, 1975 11:13:00")},
            {tag: "date string at year boundary lower", testValue: '2013-01-01'},
            {tag: "date string at year boundary upper", testValue: '2013-12-31'},
            {tag: "datetime string", testValue: '2013-10-23T23:55:00'},
            {tag: "datetime string ISO 8601   Z", testValue: '1997-07-16T19:20:30.45Z'},
            {tag: "datetime string ISO 8601 +01", testValue: '1997-07-16T19:20:30.45+01:00'},
            {tag: "datetime string ISO 8601 +10", testValue: '1997-07-16T19:20:30.45+10:00'},
            {tag: "datetime string ISO 8601 -01", testValue: '1997-07-16T19:20:30.45-01:00'},
            {tag: "datetime string ISO 8601 -10", testValue: '1997-07-16T19:20:30.45-10:00'},
            {tag: "datetime string ISO 8601 +10 at boundary", testValue: '1997-01-01T00:00:01.45+10:00'},
            {tag: "datetime string ISO 8601 -10 at boundary", testValue: '1997-12-31T23:59:59.45-10:00'}
        ]
    }
    function test_rsvpDateProperties(data) {

        console.log()//print the separate cases

        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempEventRsvp = utility.create_testobject("import QtOrganizer 5.0; EventRsvp{}", organizerItemDetailTests)
        detailChangedSpy.target = tempEventRsvp
        detailChangedSpy.signalName = "detailChanged"

        var testDate = (typeof data.testValue == 'string') ? new Date(data.testValue) : data.testValue;
        var expectedDate = (data.hasOwnProperty('expectedValue') && typeof data.expectedValue == 'string') ? new Date(data.expectedValue) : testDate;
        var testDateUTCMidnight = utility.toUTCMidnight(expectedDate);

        if (isNaN(testDate.getTime())) {
            warn("test \"" + data.tag + "\" contains incorrect date");
            return;
        }

        // responseDeadline
        tempEventRsvp.responseDeadline = data.testValue
        detailChangedSpy.wait(waitTime)
        compare(tempEventRsvp.value(EventRsvp.FieldResponseDeadline), testDateUTCMidnight);
        compare(tempEventRsvp.responseDeadline.toString(), testDateUTCMidnight.toString())
        compare(detailChangedSpy.count, 1)

        // responseDate
        tempEventRsvp.setValue(EventRsvp.FieldResponseDate, data.testValue);
        detailChangedSpy.wait(waitTime)
        compare(tempEventRsvp.responseDate.toString(), testDateUTCMidnight.toString())
        compare(tempEventRsvp.value(EventRsvp.FieldResponseDate), testDateUTCMidnight);
        compare(detailChangedSpy.count, 2)
    }

    function test_rsvpParticipationStatus_data() {
        return [
            {tag: "StatusUnknown", testValue: EventAttendee.StatusUnknown},
            {tag: "StatusAccepted", testValue: EventAttendee.StatusAccepted},
            {tag: "StatusDeclined", testValue: EventAttendee.StatusDeclined},
            {tag: "StatusTentative", testValue: EventAttendee.StatusTentative},
            {tag: "StatusDelegated", testValue: EventAttendee.StatusDelegated},
            {tag: "StatusInProcess", testValue: EventAttendee.StatusInProcess},
            {tag: "StatusCompleted", testValue: EventAttendee.StatusCompleted},
            {tag: "non existing - number", testValue: 123},
        ]
    }
    function test_rsvpParticipationStatus(data) {
        console.log()//print the separate cases
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempEventRsvp = utility.create_testobject("import QtOrganizer 5.0; EventRsvp{}", organizerItemDetailTests)
        detailChangedSpy.target = tempEventRsvp
        detailChangedSpy.signalName = "detailChanged"
        var defaultValue = EventAttendee.StatusUnknown == data.testValue ? true : false;

        tempEventRsvp.participationStatus = data.testValue
        if (!defaultValue)
            detailChangedSpy.wait(waitTime)
        compare(detailChangedSpy.count, defaultValue ? 0 : 1)
        compare(tempEventRsvp.participationStatus, data.testValue)
    }

    function test_rsvpParticipationRole_data() {
        return [
            {tag: "RoleUnknown", testValue: EventAttendee.RoleUnknown},
            {tag: "RoleOrganizer", testValue: EventAttendee.RoleOrganizer},
            {tag: "RoleChairperson", testValue: EventAttendee.RoleChairperson},
            {tag: "RoleHost", testValue: EventAttendee.RoleHost},
            {tag: "RoleRequiredParticipant", testValue: EventAttendee.RoleRequiredParticipant},
            {tag: "RoleOptionalParticipant", testValue: EventAttendee.RoleOptionalParticipant},
            {tag: "RoleNonParticipant", testValue: EventAttendee.RoleNonParticipant},
            {tag: "non existing - number", testValue: 123},
        ]
    }
    function test_rsvpParticipationRole(data) {
        console.log()//print the separate cases
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempEventRsvp = utility.create_testobject("import QtOrganizer 5.0; EventRsvp{}", organizerItemDetailTests)
        detailChangedSpy.target = tempEventRsvp
        detailChangedSpy.signalName = "detailChanged"
        var defaultValue = EventAttendee.RoleUnknown == data.testValue ? true : false;

        tempEventRsvp.participationRole = data.testValue
        if (!defaultValue)
            detailChangedSpy.wait(waitTime)
        compare(detailChangedSpy.count, defaultValue ? 0 : 1)
        compare(tempEventRsvp.participationRole, data.testValue)
    }

    function test_rsvpResponseRequirement_data() {
        return [
            {tag: "ResponseNotRequired", testValue: EventRsvp.ResponseNotRequired},
            {tag: "ResponseRequired", testValue: EventRsvp.ResponseRequired},
            {tag: "non existing - number", testValue: 123},
        ]
    }
    function test_rsvpResponseRequirement(data) {
        console.log()//print the separate cases
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests)
        var tempEventRsvp = utility.create_testobject("import QtOrganizer 5.0; EventRsvp{}", organizerItemDetailTests)
        detailChangedSpy.target = tempEventRsvp
        detailChangedSpy.signalName = "detailChanged"
        var defaultValue = EventRsvp.ResponseNotRequired == data.testValue ? true : false;

        tempEventRsvp.responseRequirement = data.testValue
        if (!defaultValue)
            detailChangedSpy.wait(waitTime)
        compare(detailChangedSpy.count, defaultValue ? 0 : 1)
        compare(tempEventRsvp.responseRequirement, data.testValue)
    }

    function test_classificationGeneralTesting() {
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests);
        detailChangedSpy.target = classification;
        detailChangedSpy.signalName = "detailChanged";
        compare(classification.type, Detail.Classification)

        // default value check
        compare(classification.classification, Classification.AccessPublic)

        // no change on value
        classification.classification = classification.classification

        compare(detailChangedSpy.count, 0)
    }

    function test_classification_data() {
        return [
            {tag: "AccessPrivate", testValue: Classification.AccessPrivate},
            {tag: "AccessConfidential", testValue: Classification.AccessConfidential}
        ]
    }
    function test_classification(data) {
        var detailChangedSpy = utility.create_testobject("import QtTest 1.0;SignalSpy{}", organizerItemDetailTests);
        var tempClassification = utility.create_testobject("import QtOrganizer 5.0; Classification{}", organizerItemDetailTests)
        detailChangedSpy.target = tempClassification;
        detailChangedSpy.signalName = "detailChanged";

        // classification
        tempClassification.classification = data.testValue
        detailChangedSpy.wait(waitTime)
        compare(tempClassification.classification, data.testValue)
        compare(detailChangedSpy.count, 1)
    }
}