mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	This lets us simplify the long-ish ‘../../static/js’ paths, and will remove the need for the ‘zrequire’ wrapper. Signed-off-by: Anders Kaseorg <anders@zulip.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			689 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			689 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
 | 
						|
const {strict: assert} = require("assert");
 | 
						|
 | 
						|
const {zrequire} = require("./lib/namespace");
 | 
						|
const {run_test} = require("./lib/test");
 | 
						|
 | 
						|
const reload_state = zrequire("reload_state");
 | 
						|
 | 
						|
function test(label, f) {
 | 
						|
    run_test(label, ({override}) => {
 | 
						|
        reload_state.clear_for_testing();
 | 
						|
        f({override});
 | 
						|
    });
 | 
						|
}
 | 
						|
 | 
						|
test("set_state_to_pending", () => {
 | 
						|
    assert.ok(!reload_state.is_pending());
 | 
						|
    reload_state.set_state_to_pending();
 | 
						|
    assert.ok(reload_state.is_pending());
 | 
						|
});
 | 
						|
 | 
						|
test("set_state_to_in_progress", () => {
 | 
						|
    assert.ok(!reload_state.is_in_progress());
 | 
						|
    reload_state.set_state_to_in_progress();
 | 
						|
    assert.ok(reload_state.is_in_progress());
 | 
						|
});
 |