Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'update-image-ampimg' of github.com:bbc-news/psammead in…
Browse files Browse the repository at this point in the history
…to update-image-ampimg
  • Loading branch information
sareh committed Jan 9, 2019
2 parents b34b7ae + 1caa121 commit ab5d1cf
Show file tree
Hide file tree
Showing 15 changed files with 664 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/utilities/gel-foundations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Description |
|---------|-------------|
| 0.1.4 | [PR#224](https://github.com/BBC-News/psammead/pull/224) Add tests for the exported values, coverage 100% :tada: |
| 0.1.1 | [PR#212](https://github.com/BBC-News/psammead/pull/212) Update package description and README. |
| 0.1.0 | [PR#221](https://github.com/BBC-News/psammead/pull/221) Create initial package, pulled in from gel-constants and gel-foundations-styled-components packages. |

2 changes: 2 additions & 0 deletions packages/utilities/gel-foundations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Our typography uses `em` for font-size and `rem` for line-height. `em` allows mo

## Contributing

When **adding** a new export to this utility package the [export tests](https://github.com/BBC-News/psammead/blob/5d7395fd60bd8d73796d5a23775b4b5b36db1445/packages/utilities/gel-foundations/index.test.jsx#L13-L59) also need to be updated. When **removing** an exisiting export from this utility package the [export tests](https://github.com/BBC-News/psammead/blob/5d7395fd60bd8d73796d5a23775b4b5b36db1445/packages/utilities/gel-foundations/index.test.jsx#L13-L59) need to be updated and the package version requires a major change (EG: 1.2.1 -> 2.0.0) as this would be considered a breaking change as functionality is being removed.

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at [the root of the Psammead respository](https://github.com/BBC-News/psammead/blob/latest/CONTRIBUTING.md).

### [Code of Conduct](https://github.com/BBC-News/psammead/blob/latest/CODE_OF_CONDUCT.md)
Expand Down
87 changes: 87 additions & 0 deletions packages/utilities/gel-foundations/index.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { testUtilityPackages } from '@bbc/psammead-test-helpers';
import * as spacings from './spacings';
import * as breakpoints from './breakpoints';
import * as typography from './typography';
import * as spacingsFromSrc from './src/spacings';
import * as breakpointsFromSrc from './src/breakpoints';
import * as typographyFromSrc from './src/typography';

const spacingsExpectedExports = {
GEL_SPACING: 'string',
GEL_SPACING_DBL: 'string',
GEL_SPACING_TRPL: 'string',
GEL_SPACING_HLF: 'string',
GEL_SPACING_QUAD: 'string',
GEL_MARGIN_BELOW_400PX: 'string',
GEL_GUTTER_BELOW_600PX: 'string',
GEL_MARGIN_ABOVE_400PX: 'string',
GEL_GUTTER_ABOVE_600PX: 'string',
};

const breakpointsExpectedExports = {
GEL_GROUP_B_MIN_WIDTH: 'number',
GEL_GROUP_B_MAX_WIDTH: 'number',
GEL_GROUP_CD_MIN_WIDTH: 'number',
GEL_GROUP_0_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_0_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_1_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_1_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_2_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_2_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_3_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_3_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_4_SCREEN_WIDTH_MIN: 'string',
GEL_GROUP_4_SCREEN_WIDTH_MAX: 'string',
GEL_GROUP_5_SCREEN_WIDTH_MIN: 'string',
MEDIA_QUERY_TYPOGRAPHY: 'object',
};

const typographyExpectedExports = {
GEL_ATLAS: 'string',
GEL_ELEPHANT: 'string',
GEL_IMPERIAL: 'string',
GEL_ROYAL: 'string',
GEL_FOOLSCAP: 'string',
GEL_CANON: 'string',
GEL_TRAFALGAR: 'string',
GEL_PARAGON: 'string',
GEL_DOUBLE_PICA: 'string',
GEL_GREAT_PRIMER: 'string',
GEL_BODY_COPY: 'string',
GEL_PICA: 'string',
GEL_LONG_PRIMER: 'string',
GEL_BREVIER: 'string',
GEL_MINION: 'string',
};

const expectedExports = {
spacings: spacingsExpectedExports,
breakpoints: breakpointsExpectedExports,
typography: typographyExpectedExports,
};

const actualExports = {
spacings,
breakpoints,
typography,
};

const actualExportsFromSrc = {
spacings: spacingsFromSrc,
breakpoints: breakpointsFromSrc,
typography: typographyFromSrc,
};

describe('Gel constants', () => {
it('should test all the utility exports exist and are the correct type', () => {
testUtilityPackages(actualExports, expectedExports, 'gel-foundations');
});

it('should test all the utility exports exist and are the correct type when coming from src/', () => {
testUtilityPackages(
actualExportsFromSrc,
expectedExports,
'gel-foundations/src',
);
});
});
152 changes: 150 additions & 2 deletions packages/utilities/gel-foundations/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions packages/utilities/gel-foundations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/gel-foundations",
"version": "0.1.3",
"version": "0.1.4",
"description": "A range of string constants for use in CSS, intended to help implement BBC GEL-compliant webpages and components.",
"repository": {
"type": "git",
Expand All @@ -23,5 +23,8 @@
"grid",
"spacing",
"typography"
]
],
"devDependencies": {
"@bbc/psammead-test-helpers": "^0.3.0"
}
}
1 change: 1 addition & 0 deletions packages/utilities/psammead-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Description |
|---------|-------------|
| 0.1.4 | [PR#224](https://github.com/BBC-News/psammead/pull/224) Add tests for the exported values, coverage 100% :tada: |
| 0.1.3 | [PR#212](https://github.com/BBC-News/psammead/pull/212) Update package description and README. |
| 0.1.2 | [PR#173](https://github.com/BBC-News/psammead/pull/173) Update PRs welcome link |
| 0.1.1 | [PR#74](https://github.com/BBC-News/psammead/pull/74) Move file contents into a src directory and babel transpile prepublish. |
Expand Down
2 changes: 2 additions & 0 deletions packages/utilities/psammead-assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { AMP_SCRIPT } from "@bbc/psammead-assets/amp-boilerplate"

## Contributing

When **adding** a new export to this utility package the [export tests](https://github.com/BBC-News/psammead/blob/5d7395fd60bd8d73796d5a23775b4b5b36db1445/packages/utilities/psammead-assets/index.test.jsx#L11-L18) also need to be updated. When **removing** an exisiting export from this utility package the [export tests](https://github.com/BBC-News/psammead/blob/5d7395fd60bd8d73796d5a23775b4b5b36db1445/packages/utilities/psammead-assets/index.test.jsx#L11-L18) need to be updated and the package version requires a major change (EG: 1.2.1 -> 2.0.0) as this would be considered a breaking change due to functionality being removed.

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at [the root of the Psammead respository](https://github.com/BBC-News/psammead/blob/latest/CONTRIBUTING.md).

### [Code of Conduct](https://github.com/BBC-News/psammead/blob/latest/CODE_OF_CONDUCT.md)
Expand Down
43 changes: 43 additions & 0 deletions packages/utilities/psammead-assets/index.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { testUtilityPackages } from '@bbc/psammead-test-helpers';
import * as svgs from './svgs';
import * as svgsFromSrc from './src/svgs';
import * as ampBoilerplate from './amp-boilerplate';
import * as ampBoilerplateFromSrc from './src/amp-boilerplate';

const ampBoilerplateExpectedExports = {
AMP_SCRIPT: 'string',
AMP_NO_SCRIPT: 'string',
};

const svgsExpectedExports = {
BBC_BLOCKS: 'string',
};

const expectedExports = {
svgs: svgsExpectedExports,
ampBoilerplate: ampBoilerplateExpectedExports,
};

const actualExports = {
svgs,
ampBoilerplate,
};

const actualExportsFromSrc = {
svgs: svgsFromSrc,
ampBoilerplate: ampBoilerplateFromSrc,
};

describe('Psammead assets', () => {
it('should test all the utility exports exist and are the correct type', () => {
testUtilityPackages(actualExports, expectedExports, 'psammead-assets');
});

it('should test all the utility exports exist and are the correct type when coming from src/', () => {
testUtilityPackages(
actualExportsFromSrc,
expectedExports,
'psammead-assets',
);
});
});
Loading

0 comments on commit ab5d1cf

Please sign in to comment.