From 225c91edb1b8380d6dfd8c04c14e006aebe5d733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 7 Jan 2025 13:29:32 -0500 Subject: [PATCH] test: add translateInPlace test --- test/utils.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/utils.js b/test/utils.js index 5a5ac44130..c3207bacbb 100644 --- a/test/utils.js +++ b/test/utils.js @@ -555,4 +555,17 @@ describe('Utility Methods', () => { }, 200); }); }); + + describe('Translator', () => { + const shim = require('../src/translator'); + + const { Translator } = shim; + it('should translate in place', async () => { + const translator = Translator.create('en-GB'); + const el = $(`
[[global:home]]
`); + await translator.translateInPlace(el.get(0)); + assert.strictEqual(el.find('#text').text(), 'Home'); + assert.strictEqual(el.find('#search').attr('title'), 'Search'); + }); + }); });