Skip to content

Commit

Permalink
Adjust for app version store
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Gertz committed Feb 5, 2016
1 parent 9347fd7 commit 5089831
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/test/units/AppVersionListComponent.test.js
Expand Up @@ -2,23 +2,36 @@ import {expect} from "chai";
import {mount} from "enzyme";

import React from "../../../node_modules/react/addons";
import AppVersionsStore from "../../js/stores/AppVersionsStore";
import AppVersionListComponent
from "../../js/components/AppVersionListComponent.jsx";
import AppVersionListItemComponent
from "../../js/components/AppVersionListItemComponent.jsx";

describe("AppVersionListComponent", function () {
import AppDispatcher from "../../js/AppDispatcher";
import AppVersionsEvents from "../../js/events/AppVersionsEvents";
import AppVersionsStore from "../../js/stores/AppVersionsStore";

before(function () {
AppVersionsStore.currentAppId = "/app-test";
AppVersionsStore.availableAppVersions = [
"2015-06-29T13:54:01.577Z",
"2015-06-29T13:02:29.615Z",
"2015-06-29T13:02:19.363Z"
];
describe("AppVersionListComponent", function () {

this.component = mount(<AppVersionListComponent appId={"/app-test"} />);
before(function (done) {
var appVersions = {
versions: [
"2015-06-29T13:54:01.577Z",
"2015-06-29T13:02:29.615Z",
"2015-06-29T13:02:19.363Z"
]
};

AppVersionsStore.once(AppVersionsEvents.CHANGE, () => {
this.component = mount(<AppVersionListComponent appId="/app-test" />);
done();
});

AppDispatcher.dispatch({
actionType: AppVersionsEvents.REQUEST_VERSION_TIMESTAMPS,
data: {body: appVersions},
appId: "/app-test"
});
});

after(function () {
Expand Down

0 comments on commit 5089831

Please sign in to comment.