Skip to content

Commit

Permalink
release: 1.2.1
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 7170760
Author: aajfranklin <[email protected]>
Date:   Sat Apr 4 12:58:02 2020 +0100

    chore: update version number in manifest

commit 3e49de5
Author: aajfranklin <[email protected]>
Date:   Sat Apr 4 12:50:52 2020 +0100

    fix: clean cache edge case

commit 810b280
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 16:04:30 2020 +0000

    docs: update readme

commit 45595c2
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 14:10:09 2020 +0000

    chore: update version number in manifest

commit 2db3457
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 14:07:06 2020 +0000

    feat: check cached player data matches current version number and update if not

commit 3a431c0
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 13:40:07 2020 +0000

    fix: state overlay taller than needed on high res displays, too much white space for short careers

commit 47a59c9
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 13:22:52 2020 +0000

    refactor: move magic numbers into config

commit 97feee3
Author: aajfranklin <[email protected]>
Date:   Sat Mar 28 12:47:52 2020 +0000

    fix: breaking issue viewing players with no seasons (e.g. just drafted)

commit cf95266
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 23:23:23 2020 +0000

    feat: include metric heights and weights

commit 5f7f86f
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 22:28:02 2020 +0000

    feat: option to reverse career rows so career and latest season display first

commit e0e4281
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 19:42:12 2020 +0000

    wip: add logic for reversing career rows, actual toggle pending

commit 8c1a9cf
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 18:57:07 2020 +0000

    feat: display stats only after hovering for half second or more

commit 6fe8fef
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 18:27:46 2020 +0000

    feat: reorder stats so most important ones are in view without scrolling

commit 1d9f19b
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 18:00:40 2020 +0000

    fix: nested names highlighting

commit ce97b73
Author: aajfranklin <[email protected]>
Date:   Fri Mar 27 15:29:34 2020 +0000

    fix: remove leading 0 from percentages
  • Loading branch information
aajfranklin committed Apr 4, 2020
1 parent eb0d251 commit 7b74dd5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Click and Roll",
"version": "1.2.0",
"version": "1.2.1",
"icons": {
"128": "./assets/static/clickAndRoll.png"
},
Expand Down
1 change: 1 addition & 0 deletions scripts/background/messageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function MessageHandler() {
cacheRecords.splice(0, Math.floor(cacheRecords.length / 2)).map(record => {
this.utils.removeFromLocalStorage(`player-${record.id}`)
});
this.utils.saveToLocalStorage('cache-records', cacheRecords);
return cacheRecords;
};

Expand Down
15 changes: 14 additions & 1 deletion tests/background.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,22 +514,35 @@ describe('Background Scripts', () => {
describe('cleanCache', () => {

let removeFromLocalStorageStub;
let saveToLocalStorageStub;

before(() => {
removeFromLocalStorageStub = sinon.stub(messageHandler.utils, 'removeFromLocalStorage');
saveToLocalStorageStub = sinon.stub(messageHandler.utils, 'saveToLocalStorage');
});

afterEach(() => {
removeFromLocalStorageStub.resetHistory();
saveToLocalStorageStub.resetHistory();
});

after(() => {
removeFromLocalStorageStub.restore();
saveToLocalStorageStub.restore();
});

it('should call remove from local storage as many times as half the length of the records', () => {
messageHandler.cleanCache([0,1,2,3,4,5,6]);
messageHandler.cleanCache([{id: 0},{id: 1},{id: 2},{id:3},{id:4},{id:5},{id:6}]);
expect(removeFromLocalStorageStub.calledThrice).to.equal(true);
expect(removeFromLocalStorageStub.firstCall.args).to.deep.equal(['player-0']);
expect(removeFromLocalStorageStub.secondCall.args).to.deep.equal(['player-1']);
expect(removeFromLocalStorageStub.thirdCall.args).to.deep.equal(['player-2']);
});

it('should save the second half of the array to local storage under cache-records', () => {
messageHandler.cleanCache([0,1,2,3,4,5,6]);
expect(saveToLocalStorageStub.calledOnce).to.equal(true);
expect(saveToLocalStorageStub.firstCall.args).to.deep.equal(['cache-records', [3,4,5,6]])
});

it('should return records from second half of the array', () => {
Expand Down

0 comments on commit 7b74dd5

Please sign in to comment.