Skip to content

Commit 8a7f13f

Browse files
committed
switch variables in parse-hours.test to const
1 parent b77d3f4 commit 8a7f13f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

source/views/building-hours/lib/__tests__/parse-hours.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,51 @@ import {parseHours} from '../parse-hours'
33
import {dayMoment, hourMoment, moment} from './moment.helper'
44

55
it('returns an {open, close} tuple', () => {
6-
let now = hourMoment('10:01am')
7-
let input = {days: [], from: '10:00am', to: '4:00pm'}
8-
let actual = parseHours(input, now)
6+
const now = hourMoment('10:01am')
7+
const input = {days: [], from: '10:00am', to: '4:00pm'}
8+
const actual = parseHours(input, now)
99

1010
expect(actual).toBeDefined()
1111
expect(actual.open).toBeDefined()
1212
expect(actual.close).toBeDefined()
1313
})
1414

1515
it('returns a Moment for .open', () => {
16-
let now = hourMoment('10:01am')
17-
let input = {days: [], from: '10:00am', to: '4:00pm'}
18-
let {open} = parseHours(input, now)
16+
const now = hourMoment('10:01am')
17+
const input = {days: [], from: '10:00am', to: '4:00pm'}
18+
const {open} = parseHours(input, now)
1919
expect(moment.isMoment(open)).toBe(true)
2020
})
2121

2222
it('returns a Moment for .close', () => {
23-
let now = hourMoment('10:01am')
24-
let input = {days: [], from: '10:00am', to: '4:00pm'}
25-
let {close} = parseHours(input, now)
23+
const now = hourMoment('10:01am')
24+
const input = {days: [], from: '10:00am', to: '4:00pm'}
25+
const {close} = parseHours(input, now)
2626
expect(moment.isMoment(close)).toBe(true)
2727
})
2828

2929
it('will add a day to the close time with nextDay:true', () => {
30-
let now = hourMoment('10:01am')
31-
let input = {days: [], from: '10:00am', to: '2:00am'}
32-
let {open, close} = parseHours(input, now)
30+
const now = hourMoment('10:01am')
31+
const input = {days: [], from: '10:00am', to: '2:00am'}
32+
const {open, close} = parseHours(input, now)
3333

3434
expect(close.isAfter(open)).toBe(true)
3535
expect(close.isAfter(now)).toBe(true)
3636
})
3737

3838
describe('handles wierd times', () => {
3939
it('handles Friday at 4:30pm', () => {
40-
let now = dayMoment('Fri 4:30pm')
41-
let input = {days: [], from: '10:00am', to: '2:00am'}
42-
let {open, close} = parseHours(input, now)
40+
const now = dayMoment('Fri 4:30pm')
41+
const input = {days: [], from: '10:00am', to: '2:00am'}
42+
const {open, close} = parseHours(input, now)
4343

4444
expect(now.isBetween(open, close)).toBe(true)
4545
})
4646

4747
it('handles Saturday at 1:30am', () => {
48-
let now = dayMoment('Sat 1:30am')
49-
let input = {days: [], from: '10:00am', to: '2:00am'}
50-
let {open, close} = parseHours(input, now)
48+
const now = dayMoment('Sat 1:30am')
49+
const input = {days: [], from: '10:00am', to: '2:00am'}
50+
const {open, close} = parseHours(input, now)
5151

5252
expect(now.isBetween(open, close)).toBe(true)
5353
})

0 commit comments

Comments
 (0)