Skip to content

Commit

Permalink
i45, related to #45 (#46)
Browse files Browse the repository at this point in the history
* Adding travis YML and updating package.json with public Config

* Removing options that package.json could not understand

* Moving to react-transcipt-testing library, incomplete implementation but it'll do.

* Removing snaps

* Ignoring test results

* 1.5.0

* Different api key

* Removing extra gh page release step

* Updated readme with the travis deployment details

* Travis to have installation step

* Adding global deps

* Updated readme with the travis deployment details

* Cleaning up tests

* Moved test to standard location
  • Loading branch information
emettely authored Mar 26, 2020
1 parent 606430b commit aab9535
Show file tree
Hide file tree
Showing 14 changed files with 5,099 additions and 6,084 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ stats.json
*.vtt
*.ttml
*.itt

# Snapshots from tests
*.snap
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
node_js:
- "12.13"
before_install:
- npm i -g rimraf
- npm i -g webpack
deploy:
provider: npm
email: [email protected]
api_key:
secure: pKBL17horvtDr+5vx2DoGZMQtyoN1vWwDOzOC5qMG+LJx1i3ATAiWggR0x43fVyPLBFN7oRXuHTdRnL0KFUlCZ3DgvW/9C/OHE46+4j5DqrlR4nHWihDSMmYcGuy9+9uJYgXki7ZHt/rrOn6ClSni9Hyxe9+wIqy0D6nzarCcRpAch+ZbYXGn0rUNv50a8G7lpfzt+1edXyyHwHnZce/xZXOQ5B2lFrbGnA/N9OxF+Vh1cO7IPua3nekj+BXp7fcSAaFcWS+KjEGfWglBOXP7pTNxg42SGd2pVOAvYN6oNhlGpoi8ELGm7sKhewVgmWqALR4Q085asR9gvkYx9rLxIi+GSqBfdTARDvwjSltCPXohoeQYfatnxX+e47rJJf1YnTHwsNZuyit4hl3WqqWgXNUHF75h4dmUzQUwBoMNUu/zVZcrv/CA0h0dXIoujbJmQgnFq7NasWA9fNxQTyp8jk+k6ACvsz/xELPiXQLIWEUn7qA/+v7kh5qnJOT5npizjpSnFINY190SIheX/2/qnBVYX+pOUvOx25RiqrQmj+nGnrv1oQNvuM8lsiXwLp5+BM0tl4MgqGme2BVWLNYTejanwgRnIy0MVKESpA3xP0xSiLyZwZSs1fZd59iI2WONwML+wzMbzQtYVxjYMGy05uZ7oUBSyjoPM0crof6Ayc=
on:
branch: release
after_deploy: npm run publish-public
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,40 @@ npm run build-storybook

Test coverage using [`jest`](https://jestjs.io/), to run tests

```
```sh
npm run test
```

## Travis CI

On commit this repo uses the [.travis.yml](./.travis.yml) config tu run the automated test on [travis CI](https://travis-ci.org/bbc/digital-paper-edit-storybook).
On commit, - this repo uses the [.travis.yml](./.travis.yml) config to run the automated test on [travis CI](https://travis-ci.org/bbc/digital-paper-edit-storybook).

## Deployment

<!-- _How to deploy the code/app into test/staging/production_ -->
### NPM

> Note that only `README.md` and the `dist` folders are published to NPM.
#### New releases

1. Go into the `release` branch and pull the new changes from `master`.
2. Commit or push changes to the remote branch of `release`
3. Find corresponding changes in [Travis](https://travis-ci.org/github/bbc/digital-paper-edit-storybook)

If you had to make changes in `release`, make sure that the `release` is equivalent to `master`!

#### Locally, using the NPM cli

To push to [npm - `@bbc/digital-paper-edit-storybook`](https://www.npmjs.com/package/@bbc/digital-paper-edit-storybook)

login into npm

```
```bash
npm run publish-public
```

This runs `npm run build` and `npm publish --access public` under the hood

> Note that only `README.md` and the `dist` folders are published to npm.
## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) guidelines.
Expand Down
20 changes: 20 additions & 0 deletions __test__/SimpleCard.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { cleanup } from '@testing-library/react';
import SimpleCard from '../src/SimpleCard';
import renderWithRouter from '../setupTests';

afterEach(cleanup);
describe('Simple Card', () => {
const props = {
id: '1',
url: 'test.com',
handleEditItem: () => {},
handleDeleteItem: () => {}
};
const { history } = renderWithRouter(<SimpleCard { ...props } />);

it('match snapshot', () => {
// tbd
});

});
8 changes: 8 additions & 0 deletions __test__/VideoContextProgressBar.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import VideoContextProgressBar from '../src/PreviewCanvas/VideoContextPreview';

describe('VideoContextProgressBar', () => {
it('should render', () => {
// tbd
});
});
1 change: 1 addition & 0 deletions config/jest/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
Loading

0 comments on commit aab9535

Please sign in to comment.