@salesforcedevs/docs-components
Advanced tools
Comparing version 0.6.0 to 0.7.0
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -17,3 +17,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "58b06bc8a8006d832bb2e25999423404bee9e523" | ||
"gitHead": "924c919f0e9214fffb628926b1ac0ad73f9304b7" | ||
} |
@@ -14,2 +14,3 @@ import Button from "dx/button"; | ||
import { Option } from "typings/custom"; | ||
import { track } from "dx/instrumentation"; | ||
@@ -20,5 +21,10 @@ const EXPECTED_QUERY_TABLET = "(max-width: 980px)"; | ||
jest.mock("dx/instrumentation"); | ||
const TAG = "doc-header"; | ||
const render = createRenderComponent(TAG, Header); | ||
const GTM_EVENT_NAME = "custEv_signUpClick"; | ||
const SIGN_UP_LABEL = "Sign Up"; | ||
const assertMediaMatchCalls = () => { | ||
@@ -89,2 +95,6 @@ expect(window.matchMedia).toBeCalledTimes(3); | ||
describe("desktop", () => { | ||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
it("renders", () => { | ||
@@ -288,2 +298,17 @@ const element = render(); | ||
}); | ||
it("signup button track is beign called", () => { | ||
const element = render(mockPropsDevelopers); | ||
const button: HTMLElement = element.shadowRoot.querySelector( | ||
"dx-button" | ||
); | ||
button.click(); | ||
expect(track).toBeCalledTimes(1); | ||
expect(track).toBeCalledWith(button, GTM_EVENT_NAME, { | ||
clickText: SIGN_UP_LABEL | ||
}); | ||
}); | ||
}); | ||
@@ -290,0 +315,0 @@ |
Sorry, the diff of this file is not supported yet
150661
3806