-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { createMediaQueries } from '../src/css-media-queries/create-media-queries'; | ||
import { breakpoints } from '../src/css-media-queries/breakpoints'; | ||
import { cssHovProperties } from '../src/css-media-queries/css-hov-properties'; | ||
import { describe, it, expect } from 'vitest' | ||
import { createMediaQueries } from '../src/css-media-queries/create-media-queries' | ||
import { breakpoints } from '../src/css-media-queries/breakpoints' | ||
import { cssHovProperties } from '../src/css-media-queries/css-hov-properties' | ||
|
||
describe('Test of the createMediaQueries and cssHovProperties methods', () => { | ||
it('Use the createMediaQueries method without breakpoints', async () => { | ||
const cssProps = { | ||
backgroundColor: 'black', | ||
fontSize: '14px', | ||
color: 'gray', | ||
}; | ||
color: 'gray' | ||
} | ||
|
||
const cssGenerated = await createMediaQueries(cssProps, breakpoints); | ||
const cssGenerated = await createMediaQueries(cssProps, breakpoints) | ||
|
||
expect(cssGenerated).toMatchObject({ | ||
'background-color': 'black', | ||
'font-size': '14px', | ||
color: 'gray', | ||
}); | ||
}); | ||
color: 'gray' | ||
}) | ||
}) | ||
|
||
it('Use the createMediaQueries method with default breakpoints', async () => { | ||
const cssProps = { | ||
backgroundColor: 'black', | ||
fontSize: { base: '12px', md: '14px', lg: '16px' }, | ||
color: 'gray', | ||
}; | ||
color: 'gray' | ||
} | ||
|
||
const cssGenerated = await createMediaQueries(cssProps, breakpoints); | ||
const cssGenerated = await createMediaQueries(cssProps, breakpoints) | ||
|
||
expect(cssGenerated).toMatchObject({ | ||
'background-color': 'black', | ||
'font-size': '12px', | ||
'@media screen and (min-width: 48em)': { 'font-size': '14px' }, | ||
'@media screen and (min-width: 62em)': { 'font-size': '16px' }, | ||
color: 'gray', | ||
}); | ||
}); | ||
color: 'gray' | ||
}) | ||
}) | ||
|
||
it('Use the cssHovProperties method', async () => { | ||
const css = { | ||
_hover: { | ||
backgroundColor: 'black', | ||
color: 'white', | ||
}, | ||
}; | ||
color: 'white' | ||
} | ||
} | ||
|
||
const cssGenerated = cssHovProperties(css); | ||
const cssGenerated = cssHovProperties(css) | ||
|
||
expect(cssGenerated).toMatchObject({ | ||
'&:hover': { 'background-color': 'black', color: 'white' }, | ||
}); | ||
}); | ||
}); | ||
'&:hover': { 'background-color': 'black', color: 'white' } | ||
}) | ||
}) | ||
}) |