From 4b56da6ec50363d461169ddaba9d9251a7d80698 Mon Sep 17 00:00:00 2001 From: Ville Vaarala Date: Mon, 6 Nov 2017 11:30:12 +0200 Subject: [PATCH] Feature/update seasons (#55) * Update repository url * Update Winter Season beginning * Remove flow type checking from prepush git hook flow-typed directory is not commited to the repository and updated definitions caused a bunch of errors that I won't fix now --- package.json | 4 ++-- src/modules/unit/constants.js | 25 +++++++++++++------------ src/modules/unit/seasons.test.js | 16 ++++++++-------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 6c3bd3e..158e2c0 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "lint": "eslint ./src", "start": "webpack-dashboard -c cyan -- node -r babel-register node_modules/.bin/webpack-dev-server --port=5000 --config=config/webpack/development.js", "test": "jest", - "prepush": "yarn lint && yarn flow && yarn test" + "prepush": "yarn lint && yarn test" }, "repository": { - "url": "git+https://github.com/nordsoftware/outdoors-sports-map.git", + "url": "git+https://github.com/digiaonline/outdoors-sports-map.git", "type": "git" }, "author": "Christoffer Niska ", diff --git a/src/modules/unit/constants.js b/src/modules/unit/constants.js index f814ccc..0d21d71 100644 --- a/src/modules/unit/constants.js +++ b/src/modules/unit/constants.js @@ -14,10 +14,7 @@ export const UnitFilters = { STATUS_ALL: 'status_all', }; -export const StatusFilters = [ - UnitFilters.STATUS_ALL, - UnitFilters.STATUS_OK, -]; +export const StatusFilters = [UnitFilters.STATUS_ALL, UnitFilters.STATUS_OK]; export const SportFilters = [ UnitFilters.SKIING, @@ -27,14 +24,14 @@ export const SportFilters = [ export type SeasonDelimiter = { day: number, - month: number, // 0-11, Jan = 0 & Dec = 11 + month: number // 0-11, Jan = 0 & Dec = 11 }; export type Season = { start: SeasonDelimiter, end: SeasonDelimiter, filters: Array -} +}; export const SummerSeason: Season = { start: { @@ -42,15 +39,15 @@ export const SummerSeason: Season = { month: 4, }, end: { - day: 14, - month: 10, + day: 31, + month: 9, }, filters: [UnitFilters.SWIMMING], }; export const WinterSeason: Season = { start: { - day: 15, + day: 1, month: 10, }, end: { @@ -109,8 +106,12 @@ export const UnitActions = { SEARCH_CLEAR: normalizeActionName('unit/SEARCH_CLEAR'), SEARCH_REQUEST: normalizeActionName('unit/SEARCH_REQUEST'), SEARCH_RECEIVE: normalizeActionName('unit/SEARCH_RECEIVE'), - FETCH_SEARCH_SUGGESTIONS: normalizeActionName('unit/FETCH_SEARCH_SUGGESTIONS'), - RECEIVE_SEARCH_SUGGESTIONS: normalizeActionName('unit/RECEIVE_SEARCH_SUGGESTIONS'), + FETCH_SEARCH_SUGGESTIONS: normalizeActionName( + 'unit/FETCH_SEARCH_SUGGESTIONS' + ), + RECEIVE_SEARCH_SUGGESTIONS: normalizeActionName( + 'unit/RECEIVE_SEARCH_SUGGESTIONS' + ), SEND_FEEDBACK: normalizeActionName('unit/SEND_FEEDBACK'), }; @@ -124,4 +125,4 @@ export type UnitState = { searchResults: Array }; -export const unitSchema = new Schema('unit'/*, {}*/); \ No newline at end of file +export const unitSchema = new Schema('unit' /*, {}*/); \ No newline at end of file diff --git a/src/modules/unit/seasons.test.js b/src/modules/unit/seasons.test.js index ea18ebb..78a8de6 100644 --- a/src/modules/unit/seasons.test.js +++ b/src/modules/unit/seasons.test.js @@ -6,8 +6,8 @@ const May1 = { month: 4, }; -const Nov15 = { - day: 15, +const Nov1 = { + day: 1, month: 10, }; @@ -58,14 +58,14 @@ test('May 1st is in year round season', () => { expect(isOnSeason(May1, YearRoundSeason)).toBe(true); }); -test('November 15th is in winter season', () => { - expect(isOnSeason(Nov15, WinterSeason)).toBe(true); +test('November 1st is in winter season', () => { + expect(isOnSeason(Nov1, WinterSeason)).toBe(true); }); -test('November 15th is not in summer season', () => { - expect(!isOnSeason(Nov15, SummerSeason)).toBe(true); +test('November 1st is not in summer season', () => { + expect(!isOnSeason(Nov1, SummerSeason)).toBe(true); }); -test('November 15th is in year round season', () => { - expect(isOnSeason(Nov15, YearRoundSeason)).toBe(true); +test('November 1st is in year round season', () => { + expect(isOnSeason(Nov1, YearRoundSeason)).toBe(true); }); \ No newline at end of file