mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 20:04:42 +08:00
FIX: Remove social sharing icons from private contexts (#10213)
This commit is contained in:
@ -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"
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user