FIX: Remove social sharing icons from private contexts (#10213)

This commit is contained in:
Penar Musaraj
2020-07-13 14:35:39 -04:00
committed by GitHub
parent e0f97c707e
commit c02e358146
5 changed files with 46 additions and 11 deletions

View File

@ -39,4 +39,29 @@ QUnit.test("addSharingId", assert => {
1,
"it adds sharing id to existing sharing settings"
);
const privateContext = true;
Sharing.addSource({
id: "another-source"
});
Sharing.addSharingId("another-source");
assert.equal(
Sharing.activeSources(sharingSettings, privateContext).length,
0,
"it does not add a regular source to sources in a private context"
);
Sharing.addSource({
id: "a-private-friendly-source",
showInPrivateContext: true
});
Sharing.addSharingId("a-private-friendly-source");
assert.equal(
Sharing.activeSources(sharingSettings, privateContext).length,
1,
"it does not add a regular source to sources in a private context"
);
});