~edwinvandeven/openstudio/2018.1

« back to all changes in this revision

Viewing changes to static/plugin_os-js/customers/depricated_edit_tests.js

  • Committer: Edwin van de Ven
  • Date: 2018-03-07 13:05:45 UTC
  • Revision ID: edwinvandeven@home.nl-20180307130545-qiz8jeyxl81dz3qk
Added a few static files to versioning system

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Created by Edwin van de Ven (edwin@openstudioproject.com)
 
3
    License: GPLv2 or v3
 
4
    
 
5
    Javascript tests for customers/edit.js
 
6
*/
 
7
var lb_teachers = "#os-lb_teachers";
 
8
var lb_teachers_content = "#os-lb_teachers-content";
 
9
var lb_backoffice = "#os-lb_backoffice";
 
10
var lb_backoffice_content = "#os-lb_backoffice-content";
 
11
 
 
12
QUnit.test("Teacher Notes lightbox", function( assert ) {
 
13
//    var fixture = $( "div.span9" );
 
14
    // Check teachers lightbox
 
15
    assert.deepEqual($(lb_teachers).css("display"), "none", "#os-lb_teachers (Teachers notes lightbox) should be hidden");
 
16
    $("#all_te_notes").click();
 
17
    assert.deepEqual($(lb_teachers).css("display"), "block", "#os-lb_teachers (Teachers notes lightbox) should be shown");
 
18
    assert.deepEqual($(lb_teachers_content).css("display"), "block", "#os-lb_teachers-content (Teachers notes lightbox) should be shown");
 
19
    
 
20
    $("#os-lb_teachers_close").click();
 
21
    var done = assert.async();
 
22
    setTimeout(function() {
 
23
        assert.deepEqual($(lb_teachers).css("display"), "none", "#os-lb_teachers (Teachers notes lightbox) should be hidden");
 
24
        assert.deepEqual($(lb_teachers_content).css("display"), "none", "#os-lb_teachers-content (Teachers notes lightbox) should be hidden");
 
25
        done();
 
26
    }, 1000); // use a timeout to allow for the fadeOut animation to complete
 
27
});
 
28
 
 
29
QUnit.test("Backoffice Notes lightbox", function( assert ) {
 
30
    // Check teachers lightbox
 
31
    assert.deepEqual($(lb_backoffice).css("display"), "none", "#os-lb_backoffice (Backoffice notes lightbox) should be hidden");
 
32
    $("#all_bo_notes").click();
 
33
    assert.deepEqual($(lb_backoffice).css("display"), "block", "#os-lb_backoffice (Backoffice notes lightbox) should be shown");
 
34
    assert.deepEqual($(lb_backoffice_content).css("display"), "block", "#os-lb_backoffice (Backoffice notes lightbox) should be shown");
 
35
    $("#os-lb_backoffice_close").click();
 
36
    var done = assert.async();
 
37
    setTimeout(function() {
 
38
        assert.deepEqual($(lb_backoffice).css("display"), "none", "#os-lb_backoffice (Backoffice notes lightbox) should be hidden");
 
39
        assert.deepEqual($(lb_backoffice_content).css("display"), "none", "#os-lb_backoffice-content (Backoffice notes lightbox) should be hidden");
 
40
        done();
 
41
    }, 1000); // use a timeout to allow for the fadeOut animation to complete
 
42
});
 
43
 
 
44