pulsar/spec/atom/window-spec.coffee
Corey Johnson & Nathan Sobo ffeaf7ed17 Remove menu code and tests
2012-02-29 13:47:48 -08:00

33 lines
959 B
CoffeeScript

$ = require 'jquery'
fs = require 'fs'
describe "Window", ->
describe "keybindings", ->
beforeEach ->
window.startup()
afterEach ->
window.shutdown()
describe ".close()", ->
it "is triggered by the 'close' event", ->
spyOn window, 'close'
$(window).trigger 'close'
expect(window.close).toHaveBeenCalled()
describe "requireStylesheet(path)", ->
it "synchronously loads the stylesheet at the given path and installs a style tag for it in the head", ->
$('head style').remove()
expect($('head style').length).toBe 0
requireStylesheet('atom.css')
expect($('head style').length).toBe 1
styleElt = $('head style')
fullPath = require.resolve('atom.css')
expect(styleElt.attr('path')).toBe fullPath
expect(styleElt.text()).toBe fs.read(fullPath)
requireStylesheet('atom.css')
expect($('head style').length).toBe 1