// FILE: _St/IG_StYellow/test_ext_side_account_click_v279aaaa.js | ROLE: v279aaaa Side IG 계정 클릭 선택 회귀 검사
const assert = require('assert');
const fs = require('fs');
const path = require('path');

const root = __dirname;
const side = fs.readFileSync(path.join(root, 'side.js'), 'utf8');
const html = fs.readFileSync(path.join(root, 'side.html'), 'utf8');
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'manifest.json'), 'utf8'));

assert.strictEqual(manifest.version, '2.3.8.3140');
assert.strictEqual(manifest.version_name, '2.3.8.314');
assert.ok(side.includes('const IGBLUE_PACKAGE_VERSION = IGBLUE_BUILD_TAG;'));
assert.ok(html.includes('disabled>IG 계정 선택</button>'));
assert.ok(html.includes('.igblue-side-account { cursor:pointer;'));
assert.ok(html.includes('.igblue-side-account:hover'));
assert.ok(side.includes('function teSelectSideAccountAddTarget(media, element)'));
assert.ok(side.includes('teAutoPySetCurrentAccountAddTarget(account, "side_account_click", shortcode);'));
assert.ok(side.includes('button.textContent = normalized ? `${normalized} 계정추가` : "IG 계정 선택";'));
assert.ok(side.includes('accountLabel.addEventListener("click"'));
assert.ok(side.includes('if (element) element.classList.add("is-account-selected");'));
assert.ok(side.includes('Side 카드의 IG 계정명을 먼저 클릭하세요.'));
assert.ok(!side.includes('teAutoPyStartCurrentAccountAddTracking'));
assert.ok(!side.includes('teAutoPyRefreshCurrentAccountAddTarget'));
assert.ok(!side.includes('teCurrentAccountAddTimer'));
assert.ok(!side.includes('teCurrentAccountAddManualSelectionUrl'));
assert.ok(!side.includes('setInterval(teAutoPyRefreshCurrentAccountAddTarget, 400)'));

console.log('test_ext_side_account_click_v279aaaa: OK');
