Spec testing against custom title bar


I’d like to write some spec tests against the new title bar settings available in macOS with Atom 1.16.0 beta. However, setting the config manually in my tests seems to have no effect.

atom.config.set('core.titleBar', 'custom')
let titleBar = workspaceElement.querySelector('.title-bar')
expect(titleBar).not.toBe(null) // FAIL

For more context, see the full spec file here: https://github.com/lexicalunit/no-title-bar/blob/41b79d30ca443310ce5c18f00f3c309bf4f6e96c/spec/no-title-bar-spec.js

Now if Atom were properly adhering to the title bar configuration, there would be an element to find. Also, the list atom.document.body.classList would contain the class custom-title-bar. But I’ve verified that it indeed does not.

I suspect that the issue is that this particular configuration must be set before Atom starts and I don’t know if a simple beforeEach(() => { atom.config.set(...) }) will actually do that.


Edit: Hrm, weird. It seems to be working now. \shrug