forked from dfdgsdfg/webflow-multilingual
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.js
More file actions
23 lines (22 loc) · 828 Bytes
/
Copy pathindex.test.js
File metadata and controls
23 lines (22 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
test("btn-lang works", () => {
document.body.innerHTML = `
<p class="wm-ko">한국어</p>
<p class="wm-en">English</p>
<p id="t1">[[ko]]한국어 [[en]]English</p>
<p>[[ko]]한국어 <br> 한국어[[en]]English <br> English</p>
<p>[[ko]]한국어
한국어
[[en]]English
English</p>
<button id="btnKo" data-wm-sel="ko">한국어</button>
<button id="btnEn" data-wm-sel="en">English</button>
<button id="btnSwitch" data-wm-switch>Switch</button>`;
require("./index");
console.log(window.defaultLang);
const btnKo = document.querySelector("#btnKo");
const btnEn = document.querySelector("#btnEn");
// const btnSwitch = document.querySelector("#btnSwitch");
btnEn.click();
btnKo.click();
expect(document.querySelector("#t1").textContent).toEqual("한국어");
});