Skip to content

Commit

Permalink
more git push debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbarker committed Jan 4, 2025
1 parent cf3481f commit 1c1ac18
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/phoenix_live_view_ts/test/integration/metadata.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { beforeEach, describe, expect, test } from "bun:test";
import * as core from '@actions/core';
import { Socket } from "phoenix_ts";
import LiveSocket from "../../src/live_socket";

Expand Down Expand Up @@ -56,16 +55,19 @@ describe("metadata", () => {
const view = liveSocket.getViewByEl(document.getElementById("root"));
view.isConnected = () => true;
const btn = view.el.querySelector("button");
let meta = {};

let metaCheck = {};
const setMetaCheck = (attrs) => {
metaCheck = attrs;
}
const getMetaCheck = () => metaCheck;

stubViewPushEvent(view, (type, el, target, phxEvent, metadata, _opts) => {
core.debug(`OUTER META: ${JSON.stringify(meta)}`);
core.debug(`INNER META: ${JSON.stringify(metadata)}`);
meta = metadata;
core.debug(`OUTER META ASSIGN ${JSON.stringify(meta)}`);
setMetaCheck(metadata);
});
btn.dispatchEvent(new Event("click", { bubbles: true }));

expect(meta).toEqual({
expect(getMetaCheck()).toEqual({

Check failure on line 70 in packages/phoenix_live_view_ts/test/integration/metadata.test.js

View workflow job for this annotation

GitHub Actions / build-and-test-job

error: expect(received).toEqual(expected)

+ {} - { - altKey: undefined, - id: "btn", - } - Expected - 4 + Received + 1 at /home/runner/work/phx_ts/phx_ts/packages/phoenix_live_view_ts/test/integration/metadata.test.js:70:28
id: "btn",
altKey: undefined,
});
Expand Down

0 comments on commit 1c1ac18

Please sign in to comment.