<commit_before>describe("Session", function() {
	beforeEach(function(){
		spyOn(Date, "now").and.returnValue(1404810612883);
	});

	describe("initialSet", function() {
		beforeEach(function() {
			spyOn(localStorage, "setItem").and.callThrough();
			localStorage.setItem.calls.reset()
			Session.initialSet()
		});

		it("sets an EntryTime", function() {
			expect(localStorage.setItem).toHaveBeenCalledWith("EntryTime", Date.now())
		});

		it("sets a Username", function() {
			expect(localStorage.setItem.calls.mostRecent().args[0]).toEqual("Username");
		});
	});



	describe("expireSession", function() {
		beforeEach(function() {
			spyOn(Window, "clearChat");
			Window.clearChat.calls.reset()
			spyOn(Window, "appendSystemMessage");
			Window.appendSystemMessage.calls.reset();
		});

		describe("when time is up", function() {
			beforeEach(function(){
				localStorage.setItem("EntryTime", Date.now() - 600001)
				Session.expireSession();
			});

			it("clears the chat", function() {
				expect(Window.clearChat).toHaveBeenCalled();
			});

			it("throws an alert", function() {
				expect(Window.appendSystemMessage).toHaveBeenCalled();
			})
		});

		describe("when time is not up", function() {
			beforeEach(function(){
				localStorage.setItem("EntryTime", Date.now() - 600000)
				Session.expireSession();
			})

			it("doesn't clear the chat", function() {
				expect(Window.clearChat).not.toHaveBeenCalled();
			});

			it("throws an alert", function() {
				expect(Window.appendSystemMessage).not.toHaveBeenCalled();
			});
		});
	});
});<commit_msg>smashed session spec again with changes to warning message<commit_after>describe("Session", function() {
	beforeEach(function(){
		spyOn(Date, "now").and.returnValue(1404810612883);
	});

	describe("initialSet", function() {
		beforeEach(function() {
			spyOn(localStorage, "setItem").and.callThrough();
			localStorage.setItem.calls.reset()
			Session.initialSet()
		});

		it("sets an EntryTime", function() {
			expect(localStorage.setItem).toHaveBeenCalledWith("EntryTime", Date.now())
		});

		it("sets a Username", function() {
			expect(localStorage.setItem.calls.mostRecent().args[0]).toEqual("Username");
		});
	});



	describe("checkTime", function() {
		beforeEach(function() {
			spyOn(Window, "clearChat");
			// Window.clearChat.calls.reset();
			
			spyOn(Window, "appendSystemMessage");
			// Window.appendSystemMessage.calls.reset();
		});

		describe("at 10mins", function() {
			beforeEach(function(){
				localStorage.setItem("EntryTime", Date.now() - 600001)
				Session.checkTime();
			});

			it("clears the chat", function() {
				expect(Window.clearChat).toHaveBeenCalled();
			});
		});

		describe("at 9 minutes", function() {
			beforeEach(function(){
				localStorage.setItem("EntryTime", Date.now() - 540001)
				Session.checkTime();
			})

			it("doesn't clear the chat", function() {
				expect(Window.clearChat).not.toHaveBeenCalled();
			});

			it("appends a warning message", function() {
				expect(Window.appendSystemMessage).toHaveBeenCalled();
			});
		});

		describe("before 9 minutes", function() {
			beforeEach(function() {
				localStorage.setItem("EntryTime", Date.now() - 539999)
				Session.checkTime();
			});
			it("doesn't clear the chat", function() {
				expect(Window.clearChat).not.toHaveBeenCalled();
			});

			it("doesn't append a warning message", function() {
				expect(Window.appendSystemMessage).not.toHaveBeenCalled();
			});
		});
	});
});
{'fraction_non_alphanumeric': 0.17964932451853982, 'fraction_numerical': 0.017821212992239148, 'mean_word_length': 4.420560747663552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6251775', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1086, 'n_words': 170}