         node.data.valueDefinedSemiQuantitatively.should.equal false
 
       it "should correctly serialize a link", ->
-        link = @graphStore.serialize().links[0]
+        jsonString = @graphStore.toJsonString()
+        link = JSON.parse(jsonString).links[0]
         link.title.should.equal ""
         link.color.should.equal "#777"
         link.sourceNode.should.equal "a"

      @graphStore.addNode @nodeB
      @graphStore.addLink @link

    describe "The serialize function", ->
      it "should serialize all the properties of the model", ->
        model = @graphStore.serialize()

        model.version.should.exist
        model.nodes.should.exist

        link.relation.text.should.equal "increases"
        link.relation.formula.should.equal "1 * in"

      it "should not serialize certain properties", ->
        jsonString = @graphStore.toJsonString()
        jsonString.should.not.match(/"description":/)
        jsonString.should.not.match(/"metadata":/)

      it "should be able to serialize the palette", ->
        console.log @graphStore.toJsonString(@fakePalette)
        jsonString = @graphStore.toJsonString(@fakePalette)
        palette = JSON.parse(jsonString).palette
        palette.a.should.equal 1
        palette.b.should.equal 2


  describe "loadData", ->
    beforeEach ->
