import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
configure({ adapter: new Adapter() });

import { IPC_TAGHISTORYUPDATE, ipcTagHistoryUpdate } from "../../app/src/actions/actions_taghistory";

describe("actions_taghistory", () => {
	describe("ipcTagHistoryUpdate", () => {
		let action;

		const sampleTag = {
			tagName: "test",
			historyRows: []
		};

		beforeEach(() => {
			action = ipcTagHistoryUpdate(undefined, sampleTag);
		});

		it("has the correct type", () => {
			expect(action.type).toEqual(IPC_TAGHISTORYUPDATE);
		});

		it("has the correct payload", () => {
			expect(action.payload).toEqual({ tagName: "test", historyRows: [] });
		});
	});
    
});