Skip to content

Commit

Permalink
update(test): add test to load a platform score
Browse files Browse the repository at this point in the history
  • Loading branch information
gierschv committed May 3, 2017
1 parent fc30d2e commit f985cc7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## v0.3.0 (unreleased)
## v0.3.0

* Add methods: `getEmbedConfig`, `setEditorConfig`, `edit`
* Add events: `edit`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bower install flat-embed
or use the latest version hosted on [jsDelivr](https://www.jsdelivr.com/projects/flat-embed):

```html
<script src="https://cdn.jsdelivr.net/flat-embed/0.2.0/embed.min.js"></script>
<script src="https://cdn.jsdelivr.net/flat-embed/0.3.0/embed.min.js"></script>
```

## Getting Started
Expand All @@ -37,7 +37,7 @@ The simplest way to get started is the pass a DOM element to our embed that will

```html
<div id="embed-container"></div>
<script src="https://cdn.jsdelivr.net/flat-embed/0.2.0/embed.min.js"></script>
<script src="https://cdn.jsdelivr.net/flat-embed/0.3.0/embed.min.js"></script>
<script>
var container = document.getElementById('embed-container');
var embed = new Flat.Embed(container, {
Expand Down
29 changes: 25 additions & 4 deletions test/integration/embed-integration.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var APP_ID = '58fa312bea9bbd061b0ea8f3',
BASE_URL = 'http://flat.io/embed',
BASE_URL = 'https://flat.io/embed',
PUBLIC_SCORE = '56ae21579a127715a02901a6';

APP_ID = '58e90082688f3e99d1244f58';
BASE_URL = 'http://flat.dev:3000/embed';
PUBLIC_SCORE = '58f93f70874b3f526d3d45e0';
// APP_ID = '58e90082688f3e99d1244f58';
// BASE_URL = 'http://flat.dev:3000/embed';
// PUBLIC_SCORE = '58f93f70874b3f526d3d45e0';

describe('Integration - Embed', () => {
describe('Loading embed', () => {
Expand Down Expand Up @@ -127,6 +127,27 @@ describe('Integration - Embed', () => {
});
});

describe('Load Platform scores', () => {
it('should load a Flat Platform score by id', (done) => {
var container = document.createElement('div');
document.body.appendChild(container);

var embed = new Flat.Embed(container, {
baseUrl: BASE_URL,
score: PUBLIC_SCORE,
embedParams: {
appId: APP_ID
}
});

embed.getJSON().then((json) => {
assert.ok(json['score-partwise']);
container.parentNode.removeChild(container);
done();
});
});
});

describe('JSON import/export', () => {
it('should import a Flat JSON file then export it', (done) => {
var container = document.createElement('div');
Expand Down

0 comments on commit f985cc7

Please sign in to comment.