Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit 65eae14

Browse files
committed
Fixed multiple interpolations within a property
1 parent 3c43e97 commit 65eae14

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/utils/general.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const isLastLineWhitespaceOnly = text => {
4545
return false
4646
}
4747
}
48-
return true
48+
return false
4949
}
5050

5151
// eslint-disable-next-line no-return-assign

test/fixtures/interpolations/valid.js

+8
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,11 @@ const Button6 = styled.button`
7171
`}
7272
background: blue;
7373
`
74+
75+
// multi interpolations within a property
76+
const borderWidth = '1px'
77+
const borderStyle = 'solid'
78+
const Button7 = styled.button`
79+
width: 20px;
80+
border: ${borderWidth} ${borderStyle} ${color};
81+
`

test/utils.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ describe('utils', () => {
4141

4242
describe('isLastLineWhitespaceOnly', () => {
4343
it('should return true for empty string', () => {
44-
expect(isLastLineWhitespaceOnly('')).toEqual(true)
44+
expect(isLastLineWhitespaceOnly('')).toEqual(false)
4545
})
4646

4747
it('should return true for string of spaces', () => {
48-
expect(isLastLineWhitespaceOnly(' ')).toEqual(true)
48+
expect(isLastLineWhitespaceOnly(' ')).toEqual(false)
4949
})
5050

5151
it('should return true for string of spaces and tabs', () => {
52-
expect(isLastLineWhitespaceOnly(' \t ')).toEqual(true)
52+
expect(isLastLineWhitespaceOnly(' \t ')).toEqual(false)
5353
})
5454

5555
it('should return false for string with something other than space and tab', () => {

0 commit comments

Comments
 (0)