Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addsenchatests #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion client/.sencha/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/temp/
/temp/

# Added by Sencha IDE Plugin
temp
20 changes: 19 additions & 1 deletion client/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* The version of the application.
*/
"version": "@@@version@@@",
"version": "2.3.6",
/**
* The relative path to the application's markup file (html, jsp, asp, etc.).
*/
Expand Down Expand Up @@ -312,6 +312,24 @@
* Settings specific to development builds.
*/
"development": {
"requires" : [
"font-awesome",
"ux"
],
"js": [
{
"path": "${framework.dir}/build/ext-modern-all-debug.js"
},
{
"path": "app.js",
"bundle": true
},
{
// default settings
"path": "ext/packages/ux/src/ajax/SimManager.js",
"bundle" : true
}
],
"output": {
"base": "${workspace.build.dir}/${build.environment}/${app.name}",
"appCache": {
Expand Down
10 changes: 8 additions & 2 deletions client/app/view/main/MainController.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@ Ext.define('Spotify.view.main.MainController', {
if (e.getTarget('.track-bookmark')) {
const vm = this.getViewModel();
const store = vm.getStore('bookmarked');
const playedStore = vm.getStore('playedTracks');

playedRecord = playedStore.findRecord("id", record.get('id'), 0, false, true, true);

if(playedRecord){
playedRecord.set('bookmarked', !record.get('bookmarked'));
}
record.set('bookmarked', !record.get('bookmarked'));

store.remove(record);
store.sync();
}
Expand Down Expand Up @@ -287,9 +294,8 @@ Ext.define('Spotify.view.main.MainController', {

if (recordIndex === -1) {

console.log(currentTrack);
const record = Ext.create('Spotify.model.BookmarkedTrack', {
// id: currentTrack.item.id,
id : currentTrack.item.id,
name : currentTrack.item.name,
link : currentTrack.item.external_urls.spotify,
artist : currentTrack.item.artists[0].name,
Expand Down
20 changes: 20 additions & 0 deletions client/test/AppInit/AppLaunch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

describe("AppLaunch", function() {

it("test", function(){
let controller;
ST.component('spotify-login').and(function(el){
controller = el.getController()
// button.getController();
spyOn(controller, 'doSpotifyLogin');

})

ST.component('spotify-login button').click(0,0).and(function(button){
debugger;
expect(controller.doSpotifyLogin).toHaveBeenCalled();

})

});
});
Loading