diaspora/spec/javascripts/app/views/content_view_spec.js
zaziemo 298e195a8f add a map subview
- add coordinates in post_presenter
- add map to the SPV if location is provided
- add leaflet.js to render map and marker of position
- make coordinates available in frontend
- add map scss
- make stream post location clickable and redirect to the SPV
- prevent render map if no location data is provided
- add tests for coordinates
- use the leaflet gem instead of the JS assets
(#5813)
2015-09-09 12:19:38 +02:00

34 lines
1 KiB
JavaScript

describe("app.views.Content", function(){
beforeEach(function(){
this.post = new app.models.StatusMessage();
this.view = new app.views.Content({model : this.post});
});
describe("rendering", function(){
it("should return all but the first photo from the post", function() {
this.post.set({photos : [1,2]}); // set 2 Photos
expect(this.view.smallPhotos().length).toEqual(1);
});
});
describe("presenter", function(){
beforeEach(function(){
this.post.set({text : ""}); // for textFormatter
});
it("provides isReshare", function(){
expect(this.view.presenter().isReshare).toBeFalsy();
});
it("provides isReshare and be true when the post is a reshare", function(){
this.post.set({post_type : "Reshare"});
expect(this.view.presenter().isReshare).toBeTruthy();
});
// it("provides coordinates", function(){
// this.post.location;
// console.log(this.view.presenter());
// console.log(this.post.location);
// });
});
});