Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
Feature/update seasons (#55)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vaaralav authored Nov 6, 2017
1 parent 4b1010e commit 4b56da6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
Expand Down
25 changes: 13 additions & 12 deletions src/modules/unit/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,30 +24,30 @@ 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<string>
}
};

export const SummerSeason: Season = {
start: {
day: 1,
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: {
Expand Down Expand Up @@ -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'),
};

Expand All @@ -124,4 +125,4 @@ export type UnitState = {
searchResults: Array<string>
};

export const unitSchema = new Schema('unit'/*, {}*/);
export const unitSchema = new Schema('unit' /*, {}*/);
16 changes: 8 additions & 8 deletions src/modules/unit/seasons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const May1 = {
month: 4,
};

const Nov15 = {
day: 15,
const Nov1 = {
day: 1,
month: 10,
};

Expand Down Expand Up @@ -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);
});

0 comments on commit 4b56da6

Please sign in to comment.