Skip to content

Commit

Permalink
Convert unlinked copying tests to vitest (#264)
Browse files Browse the repository at this point in the history
* also added fix: do not expand replacements when returning state variables

---------

Co-authored-by: Duane Nykamp <[email protected]>
  • Loading branch information
cqnykamp and dqnykamp authored Nov 30, 2024
1 parent fdd9bf4 commit 049da57
Show file tree
Hide file tree
Showing 4 changed files with 602 additions and 1,082 deletions.
14 changes: 14 additions & 0 deletions packages/doenetml-worker/src/CoreWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ async function returnAllStateVariables(core) {
stateValues: {},
});
for (let vName in component.state) {
if (
[
"replacements",
"recursiveReplacements",
"fullRecursiveReplacements",
].includes(vName) &&
core.componentInfoObjects.isCompositeComponent({
componentType: component.componentType,
}) &&
!component.isExpanded
) {
// don't expand a composite to get these replacement state variables
continue;
}
compObj.stateValues[vName] = removeFunctionsMathExpressionClass(
await component.state[vName].value,
);
Expand Down
Loading

0 comments on commit 049da57

Please sign in to comment.