Remove ‘group’ parameter to addStyleSheet in favor of ‘priority’

This commit is contained in:
Nathan Sobo
2015-01-06 20:08:45 -07:00
parent 2c1f8ce733
commit 7dd67caf57
8 changed files with 23 additions and 77 deletions

View File

@@ -53,29 +53,6 @@ describe "StyleManager", ->
expect(addEvents[0].getAttribute('source-path')).toBe '/foo/bar'
expect(addEvents[0].textContent).toBe "a {color: yellow;}"
describe "when a group parameter is specified", ->
it "inserts the stylesheet at the end of any existing stylesheets for the same group", ->
manager.addStyleSheet("a {color: red}", group: 'a')
manager.addStyleSheet("a {color: blue}", group: 'b')
manager.addStyleSheet("a {color: green}", group: 'a')
expect(manager.getStyleElements().map (elt) -> elt.textContent).toEqual [
"a {color: red}"
"a {color: green}"
"a {color: blue}"
]
it "assigns priorities to 'bundled', 'theme', and 'user' groups that place them in the proper order", ->
manager.addStyleSheet("a {color: red}", group: 'user')
manager.addStyleSheet("a {color: blue}", group: 'bundled')
manager.addStyleSheet("a {color: green}", group: 'theme')
expect(manager.getStyleElements().map (elt) -> elt.textContent).toEqual [
"a {color: blue}"
"a {color: green}"
"a {color: red}"
]
describe "when a priority parameter is specified", ->
it "inserts the style sheet based on the priority", ->
manager.addStyleSheet("a {color: red}", priority: 1)