test: exercise migrated workflow offline
This commit is contained in:
parent
d80091d244
commit
85a000422d
|
|
@ -40,7 +40,7 @@ const cache = {{
|
||||||
state.puts.push(key);
|
state.puts.push(key);
|
||||||
state.migrated.push(key);
|
state.migrated.push(key);
|
||||||
state.activationOrder.push('put:' + key);
|
state.activationOrder.push('put:' + key);
|
||||||
storedResponses.set(key, response.clone());
|
storedResponses.set(new URL(key, 'https://forge.example').href, response.clone());
|
||||||
}},
|
}},
|
||||||
}};
|
}};
|
||||||
const oldCache = {{
|
const oldCache = {{
|
||||||
|
|
@ -1080,20 +1080,27 @@ def test_offline_activation_migrates_cached_optional_feature_before_deleting_old
|
||||||
state.failedAdds = [asset];
|
state.failedAdds = [asset];
|
||||||
context.self.__testOptionalFeatures.push(asset);
|
context.self.__testOptionalFeatures.push(asset);
|
||||||
await dispatch('activate');
|
await dispatch('activate');
|
||||||
process.stdout.write(JSON.stringify(state));
|
state.failFetch = true;
|
||||||
|
const response = await dispatch('fetch', {
|
||||||
|
method: 'GET', mode: 'cors',
|
||||||
|
url: 'https://forge.example/dashboard/feature-issue-capture-test.js',
|
||||||
|
});
|
||||||
|
process.stdout.write(JSON.stringify({ body: await response.text(), state }));
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["migrated"] == [
|
assert result["body"] == "previous cached feature"
|
||||||
|
state = result["state"]
|
||||||
|
assert state["migrated"] == [
|
||||||
"/dashboard/feature-issue-capture-test.js"
|
"/dashboard/feature-issue-capture-test.js"
|
||||||
]
|
]
|
||||||
assert result["individuallyAdded"] == []
|
assert state["individuallyAdded"] == []
|
||||||
assert "/dashboard/feature-issue-capture-test.js" not in result["addAttempts"]
|
assert "/dashboard/feature-issue-capture-test.js" not in state["addAttempts"]
|
||||||
assert result["activationOrder"] == [
|
assert state["activationOrder"] == [
|
||||||
"put:/dashboard/feature-issue-capture-test.js",
|
"put:/dashboard/feature-issue-capture-test.js",
|
||||||
"delete:stackchain-dashboard-old",
|
"delete:stackchain-dashboard-old",
|
||||||
]
|
]
|
||||||
assert result["claimed"] is True
|
assert state["claimed"] is True
|
||||||
|
|
||||||
|
|
||||||
def test_activate_warms_optional_features_without_blocking_siblings_or_claim():
|
def test_activate_warms_optional_features_without_blocking_siblings_or_claim():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user