Skip to content

Commit

Permalink
Merge pull request #49 from reapit/feature/CLD-291-style-tweaks
Browse files Browse the repository at this point in the history
[CLD-291] A few width tweaks
  • Loading branch information
willmcvay authored Oct 11, 2019
2 parents eae26c1 + 6a2bcba commit 735210e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 115 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test-e2e:ci": "concurrently --success=\"first\" \"yarn start\" \"yarn test-e2e\" -k"
},
"dependencies": {
"@reapit/elements": "^0.4.15",
"@reapit/elements": "^0.4.21",
"dayjs": "^1.8.16",
"formik": "^1.5.8",
"hardtack": "^4.1.0",
Expand Down Expand Up @@ -78,6 +78,7 @@
"lint-staged": "^8.1.7",
"loader-utils": "^1.2.3",
"mini-css-extract-plugin": "^0.7.0",
"mockdate": "^2.0.5",
"node-sass": "^4.12.0",
"prettier": "^1.17.1",
"prettier-plugin-packagejson": "^2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/sagas/__tests__/appointments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('appointments should fetch data', () => {
expect(gen.next(mockHeaders).value).toEqual(
call(fetcher, {
url:
'/appointments?Start=2019-12-18T00:00:00.000Z&End=2019-12-18T23:59:59.999Z&IncludeCancelled=true&IncludeUnconfirmed=true',
'/appointments?Start=2019-10-10T00:00:00.000Z&End=2019-10-10T23:59:59.999Z&IncludeCancelled=true&IncludeUnconfirmed=true',
api: REAPIT_API_BASE_URL,
method: 'GET',
headers: mockHeaders
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('appointments should fetch data', () => {
expect(gen.next(mockHeaders).value).toEqual(
call(fetcher, {
url:
'/appointments?Start=2019-12-18T00:00:00.000Z&End=2019-12-18T23:59:59.999Z&IncludeCancelled=true&IncludeUnconfirmed=true',
'/appointments?Start=2019-10-10T00:00:00.000Z&End=2019-10-10T23:59:59.999Z&IncludeCancelled=true&IncludeUnconfirmed=true',
api: REAPIT_API_BASE_URL,
method: 'GET',
headers: mockHeaders
Expand Down
10 changes: 7 additions & 3 deletions src/scripts/jest-setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Adapter = require('enzyme-adapter-react-16')
const Enzyme = require('enzyme')
const fetchMock = require('jest-fetch-mock')
const MockDate = require('mockdate')

Enzyme.configure({ adapter: new Adapter() })
global.fetch = fetchMock
Expand Down Expand Up @@ -38,6 +39,9 @@ window.matchMedia =
}
}

jest.mock('dayjs', () =>
jest.fn((...args) => jest.requireActual('dayjs')(args.filter(arg => arg).length > 0 ? args : '2019-12-18T16:30:00'))
)
// Had to remove this mock because dayjs.extend throws an error as not being mocked - see this PR: https://github.com/reapit/elements/pull/82
// jest.mock('dayjs', () =>
// jest.fn((...args) => jest.requireActual('dayjs')(args.filter(arg => arg).length > 0 ? args : '2019-12-18T16:30:00'))
// )
// Replaced with this for now:
MockDate.set(1570747191389)
8 changes: 4 additions & 4 deletions src/styles/pages/map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.mapContainer {
overflow: hidden;
position: absolute;
left: 366px;
width: calc(100vw - 366px);
left: 382px;
width: calc(100vw - 376px);
top: 0;
height: 100%;

Expand Down Expand Up @@ -49,8 +49,8 @@
.mapPanel {
position: absolute;
bottom: 0;
width: calc(100vw - 366px);
left: 366px;
width: calc(100vw - 382px);
left: 382px;
display: flex;
background-color: #fff;
padding: 1.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/styles/pages/page-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
position: absolute;
background:rgb(249, 251, 253);
height: 100%;
width: 300px;
width: 316px;
left: 66px;
top: 0;
overflow: scroll;
Expand Down
96 changes: 0 additions & 96 deletions src/styles/utilities.scss

This file was deleted.

8 changes: 4 additions & 4 deletions src/utils/__tests__/get-next-appointments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { AppointmentModel } from '@/types/appointments'
describe('getTodayNextAppointment', () => {
test('Should return the next appointment in today', () => {
const appointments: AppointmentModel[] = [
{ start: '2019-12-18T16:30:00' },
{ start: '2019-14-18T16:30:00' },
{ start: '2019-12-18T17:10:00' }
{ start: '2019-10-10T22:00:00' },
{ start: '2019-10-10T22:45:00' },
{ start: '2019-10-10T23:00:00' }
]
expect(getTodayNextAppointment(appointments)).toBe(appointments[2])
expect(getTodayNextAppointment(appointments)).toBe(appointments[1])
})

test('Should return undefined if appointments are from another day(s)', () => {
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@
"@types/istanbul-reports" "^1.1.1"
"@types/yargs" "^13.0.0"

"@reapit/elements@^0.4.15":
version "0.4.15"
resolved "https://registry.yarnpkg.com/@reapit/elements/-/elements-0.4.15.tgz#1529fa7c9cc88f2649148b085e19e6ab133c71aa"
integrity sha512-wltKu6nJXmhHe4d6kwiVtVJylOlAdkg4SfuDKwaJ1gStRPOvBdvB2GXio0Hu2yQ0iadFa45oiD2L51ikCWOD8g==
"@reapit/elements@^0.4.21":
version "0.4.21"
resolved "https://registry.yarnpkg.com/@reapit/elements/-/elements-0.4.21.tgz#5373a5aa9bdfa583390415b5538d6ba6886abda5"
integrity sha512-PCaqMJ1it7RUpD63cEmluLVvQpJVjXMA2RUr7n2TsGR64zi/AIxeDXiT7qZR7JOOCE3TePwsDiGTiidSYUKhYw==
dependencies:
bulma "^0.7.5"
dayjs "^1.8.16"
Expand Down Expand Up @@ -6350,6 +6350,11 @@ [email protected], [email protected], [email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@
dependencies:
minimist "0.0.8"

mockdate@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/mockdate/-/mockdate-2.0.5.tgz#70c6abf9ed4b2dae65c81dfc170dd1a5cec53620"
integrity sha512-ST0PnThzWKcgSLyc+ugLVql45PvESt3Ul/wrdV/OPc/6Pr8dbLAIJsN1cIp41FLzbN+srVTNIRn+5Cju0nyV6A==

moo@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
Expand Down

0 comments on commit 735210e

Please sign in to comment.