-
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.
Merge pull request #29 from heyjul3s/refactor/package-rename
Func Rename
- Loading branch information
Showing
13 changed files
with
70 additions
and
69 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
This file was deleted.
Oops, something went wrong.
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,19 +1,35 @@ | ||
import { createBlockComponents } from '../src'; | ||
import { mockBlockStyles } from '../__mocks__/block.mock'; | ||
import { createBlocks } from '../src'; | ||
|
||
describe('@artifak/block', () => { | ||
describe('createBlockComponents - generates Block React components based on styles object argument provided', () => { | ||
describe('createBlocks - generates Block React components based on styles object argument provided', () => { | ||
it('should return the base Typography system component when provided with an invalid argument', () => { | ||
const expected = {}; | ||
expect(createBlockComponents({} as any)).toEqual(expected); | ||
expect(createBlockComponents(null as any)).toEqual(expected); | ||
expect(createBlockComponents(false as any)).toEqual(expected); | ||
expect(createBlockComponents(0 as any)).toEqual(expected); | ||
expect(createBlockComponents(void 0 as any)).toEqual(expected); | ||
expect(createBlocks({} as any, {} as any)).toEqual(expected); | ||
expect(createBlocks(null as any, null as any)).toEqual(expected); | ||
expect(createBlocks(false as any, false as any)).toEqual(expected); | ||
expect(createBlocks(0 as any, 0 as any)).toEqual(expected); | ||
expect(createBlocks(void 0 as any, void 0 as any)).toEqual(expected); | ||
}); | ||
|
||
it('should create React components', () => { | ||
expect(createBlockComponents(mockBlockStyles)).toBeDefined(); | ||
expect( | ||
createBlocks( | ||
{ | ||
styles: { | ||
display: 'block' | ||
} | ||
}, | ||
{ | ||
BlockPadSM: { | ||
padding: [15] | ||
}, | ||
|
||
BlockPadMD: { | ||
padding: [15, 30] | ||
} | ||
} | ||
) | ||
).toBeDefined(); | ||
}); | ||
}); | ||
}); |
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
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
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,3 +1,3 @@ | ||
export { createBlockComponents } from './createBlockComponents'; | ||
export { createBlocks } from './createBlocks'; | ||
export { BlockBase } from './BlockBase'; | ||
export { BlockBaseProps } from './typings'; |
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
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
36 changes: 0 additions & 36 deletions
36
packages/typography/__tests__/createTypoComponents.test.ts
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { position } from 'styled-system'; | ||
import { createTypography, getStyleProps, fontWeight } from '../src'; | ||
|
||
describe('createTypography - generates typography React components based on styles object argument provided', () => { | ||
it('should return the base Typography system component when provided with an invalid argument', () => { | ||
expect(createTypography({} as any, {} as any)).toHaveProperty('Base'); | ||
expect(createTypography(null as any, null as any)).toHaveProperty('Base'); | ||
expect(createTypography(false as any, false as any)).toHaveProperty('Base'); | ||
expect(createTypography(0 as any, 0 as any)).toHaveProperty('Base'); | ||
expect(createTypography(void 0 as any, void 0 as any)).toHaveProperty( | ||
'Base' | ||
); | ||
}); | ||
|
||
it('should create React components', () => { | ||
expect( | ||
createTypography( | ||
{}, | ||
{ | ||
H1: { | ||
marginBottom: [15], | ||
as: 'h1' | ||
} | ||
} | ||
) | ||
).toBeDefined(); | ||
}); | ||
}); |
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
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
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,4 +1,4 @@ | ||
export { createTypoComponents, getStyleProps } from './createTypoComponents'; | ||
export { createTypography, getStyleProps } from './createTypography'; | ||
export { TypographyBase } from './TypographyBase'; | ||
export { fontWeight } from './fontWeight'; | ||
export { TypographyBaseProps } from './typings'; |