mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove ‘group’ parameter to addStyleSheet in favor of ‘priority’
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user