mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	* renamed the 'icon-star' style to 'icon-vector-star' to keep backwards compatibility for icon-* classes * changed relevant styles in zephyr.css; added FontAwesome assets * changed relevant CSS classes in base.html, left-sidebar.html, ui.js, message.handlebars * added new fonts.css to start consolidating all font-based assets * added fonts.css to PIPELINE_CSS in settings.py under 'portico' and 'app' * modified the stars test suite to reflect new star icon class name. (imported from commit 3116fcfd4b5fb4edecd457da554fea616bb7081b)
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
var common = require('../common.js').common;
 | 
						|
 | 
						|
function star_count() {
 | 
						|
    return casper.evaluate(function () {
 | 
						|
        return $("#zhome .icon-vector-star").length;
 | 
						|
    });
 | 
						|
}
 | 
						|
 | 
						|
function toggle_last_star() {
 | 
						|
    casper.evaluate(function () {
 | 
						|
        $("#zhome .star").last().click();
 | 
						|
    });
 | 
						|
}
 | 
						|
 | 
						|
common.start_and_log_in();
 | 
						|
 | 
						|
casper.then(function() {
 | 
						|
    casper.test.info("Sending test message");
 | 
						|
    common.send_message('stream', {
 | 
						|
        stream:  'Verona',
 | 
						|
        subject: 'stars',
 | 
						|
        content: 'test star'
 | 
						|
    });
 | 
						|
    casper.waitForText("test star");
 | 
						|
});
 | 
						|
 | 
						|
casper.then(function() {
 | 
						|
    casper.test.info("Checking star counts");
 | 
						|
 | 
						|
    // Initially, no messages are starred.
 | 
						|
    casper.test.assertEquals(star_count(), 0,
 | 
						|
                             "Got expected empty star count.");
 | 
						|
 | 
						|
    // Clicking on a message star stars it.
 | 
						|
    toggle_last_star();
 | 
						|
    casper.test.assertEquals(star_count(), 1,
 | 
						|
                             "Got expected single star count.");
 | 
						|
 | 
						|
    casper.click('a[href^="#narrow/is/starred"]');
 | 
						|
});
 | 
						|
 | 
						|
casper.then(function() {
 | 
						|
    // You can narrow to your starred messages.
 | 
						|
    common.expected_messages('zfilt', ['Verona > stars'], ['<p>test star</p>']);
 | 
						|
    common.un_narrow();
 | 
						|
});
 | 
						|
 | 
						|
casper.then(function() {
 | 
						|
    // Clicking on a starred message unstars it.
 | 
						|
    toggle_last_star();
 | 
						|
    casper.test.assertEquals(star_count(), 0,
 | 
						|
                             "Got expected re-empty star count.");
 | 
						|
});
 | 
						|
 | 
						|
common.then_log_out();
 | 
						|
 | 
						|
casper.run(function () {
 | 
						|
    casper.test.done();
 | 
						|
});
 |