-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Album View Page): Next/Prev arrows will load cached photo image …
…when possible
- Loading branch information
Showing
6 changed files
with
73 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* global describe, expect, test */ | ||
import { determineAdjacentInCarousel } from '../saga'; | ||
|
||
/* eslint-disable default-case, no-param-reassign */ | ||
describe('InfiniteThumbs Saga', () => { | ||
describe('determineAdjacentInCarousel', () => { | ||
describe('should handle the currentMemory action correctly', () => { | ||
const testState = { | ||
memories: [ | ||
{ id: 1 }, | ||
{ id: 2 }, | ||
{ id: 3 }, | ||
], | ||
currentMemory: { | ||
id: 2, | ||
}, | ||
}; | ||
|
||
test('should be one after ID two', () => { | ||
expect(determineAdjacentInCarousel({ adjacentInt: 1, ...testState })).toEqual(3); | ||
}); | ||
|
||
test('should be one before ID two', () => { | ||
expect(determineAdjacentInCarousel({ adjacentInt: -1, ...testState })).toEqual(1); | ||
}); | ||
|
||
test('should be two after ID two', () => { | ||
expect(determineAdjacentInCarousel({ adjacentInt: 2, ...testState })).toEqual(1); | ||
}); | ||
|
||
test('should be two before ID two', () => { | ||
expect(determineAdjacentInCarousel({ adjacentInt: -2, ...testState })).toEqual(3); | ||
}); | ||
}); | ||
}); | ||
}); |