     UiSettings.set(one: 'five')
     UiSettings.set(one: 'six', deep: {bar: 'foo'})
     UiSettings.set(one: 'seven')
-    jest.runAllTimers()
-    expect(Networking.perform).to.have.been.calledOnce
-
-    expect(Networking.perform.lastCall.args[0].data?.ui_settings).to.eql(
-      one: 'seven', two: 'III', deep: { bar: 'foo'}
-    )
+    expect(saveSettingsMock).toHaveBeenCalledTimes(3)
     undefined
 
   it 'can set with key and id', ->

{sinon, _} = require 'shared/specs/helpers'
{ autorun } = require 'mobx';
UiSettings = require 'model/ui-settings'
Networking = require 'model/networking'

jest.useFakeTimers();

describe 'UiSettings', ->

  beforeEach ->
    sinon.stub(Networking, 'perform').returns(
      then: (fn) -> fn({})
    )


  afterEach ->
    UiSettings._reset()

  it 'saves when set', ->
    initialSetting = {'one': 1, 'two':'II'}
    UiSettings.initialize(initialSetting)

    UiSettings.set(one: 'five')
    expect(saveSettingsMock).toHaveBeenCalledTimes(1)

  it 'groups saves together', ->
    initialSetting = {one: 18, two:'III', deep: {key: 'value', bar: 'bz'}}
