{:uriI"file:///Users/prehnra/src/revelry_core/spec/dummy/spec/javascripts/core_spec.js?type=application/javascript&pipeline=self&id=7e52c4a1238dd931a62e3aa7d2eb7e9025ad3a039f38bd4fa038c7766f43addb:ET:load_pathI"@/Users/prehnra/src/revelry_core/spec/dummy/spec/javascripts;F: filenameI"M/Users/prehnra/src/revelry_core/spec/dummy/spec/javascripts/core_spec.js;T: nameI"core_spec;T:logical_pathI"core_spec.self.js;T:content_typeI"application/javascript;T: sourceI" describe("Rev", function() { function FunctionClass(initialProps) { return { render: function() { return React.createElement('span'); } } } var reference = {render: function() {}}; App.Components.FunctionClass.Index = FunctionClass; beforeEach(function(){ this.componentSpec = {render: function() { return React.createElement('span'); }}; }); it("can register a new object", function() { Rev.registerObject('_registerObjectTest', reference); expect(Rev._registerObjectTest).toBe(reference); }); it("can register a new app object", function() { Rev.appObject('_appObjectTest', reference); expect(App._appObjectTest).toBe(reference); }); it("can register a new component", function() { Rev.registerComponent('_registerComponent', this.componentSpec); expect(Rev.Components._registerComponent).toBeDefined(); }); it("can register a new app component", function() { Rev.appComponent('_appComponent', this.componentSpec); expect(App.Components._appComponent).toBeDefined(); }); it("warns you if you attempt to mixin which doesn't exist", function() { spyOn(console, 'warn'); Rev.registerComponent('_nullMixinWarning', {mixins: [null], render: function() {}}); expect(console.warn).toHaveBeenCalled(); }); it("includes the core mixin", function() { var arrayWithCore = jasmine.arrayContaining([Rev.Mixins.Core]); Rev.registerComponent('_coreMixinFunctions', this.componentSpec); expect(this.componentSpec.mixins).toEqual(arrayWithCore); }); it("can render a component to a string with the ujs class", function() { var result; Rev.appComponent('Ujs.Index', this.componentSpec); result = Rev.viewToString('ujs/index', '{}'); expect(result).toContain('data-react-class="App.Components.Main"'); }); it("can render a function component", function() { var result = Rev.viewToString('function_class/index', '{}'); expect(result).toContain('data-react-class="App.Components.FunctionClass.Index"'); }); }); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"[file-digest:///Users/prehnra/src/revelry_core/spec/dummy/spec/javascripts/core_spec.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%u ws 4)W5N*/$: lengthi :integrityI"9sha-256-dYcgd3O8qAm3ANXBNAd/u7jU1CmHkFc1TuzO3yov0yQ=;T:dependencies_digest"%fj,0"=ՄpͶalP/﹢:idI"E7e52c4a1238dd931a62e3aa7d2eb7e9025ad3a039f38bd4fa038c7766f43addb;F: mtimel+fVQU