Skip to content

Commit

Permalink
Fix tag removal test for editor page
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarlow12 authored and wbreza committed Apr 29, 2019
1 parent 5b4610b commit bbd83a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/react/components/pages/editorPage/editorPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { appInfo } from "../../../../common/appInfo";
import SplitPane from "react-split-pane";
import EditorSideBar from "./editorSideBar";
import Alert from "../../common/alert/alert";
import registerMixins from "../../../../registerMixins";

function createComponent(store, props: IEditorPageProps): ReactWrapper<IEditorPageProps, IEditorPageState, EditorPage> {
return mount(
Expand Down Expand Up @@ -657,6 +658,11 @@ describe("Editor Page Component", () => {
});

describe("Basic tag interaction tests", () => {

beforeAll(() => {
registerMixins();
});

it("tags are initialized correctly", () => {
const project = MockFactory.createTestProject();
const store = createReduxStore({
Expand Down Expand Up @@ -700,6 +706,9 @@ describe("Editor Page Component", () => {
expect(getState(wrapper).project.tags).toEqual(project.tags);
wrapper.find(".tag-content").last().simulate("click");
wrapper.find("i.tag-input-toolbar-icon.fas.fa-trash").simulate("click");
wrapper.find("button.btn.btn-danger").simulate("click");

await MockFactory.flushUi();

const stateTags = getState(wrapper).project.tags;
expect(stateTags).toHaveLength(project.tags.length - 1);
Expand Down

0 comments on commit bbd83a4

Please sign in to comment.