forked from NickColley/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to always expand posts marked with content warnings (n…
…olanlawson#2342) Co-authored-by: Nolan Lawson <nolan@nolanlawson.com>
- Loading branch information
1 parent
509f640
commit 64ed143
Showing
6 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
getUrl, | ||
scrollToStatus, | ||
getNthStatusSpoiler, | ||
settingsNavButton, | ||
generalSettingsButton, | ||
homeNavButton, | ||
getNthStatus, | ||
getNthShowOrHideButton | ||
} from '../utils' | ||
import { loginAsFoobar } from '../roles' | ||
import { homeTimeline } from '../fixtures.js' | ||
import { Selector as $ } from 'testcafe' | ||
|
||
fixture`043-content-warnings.js` | ||
.page`http://localhost:4002` | ||
|
||
test('Can set content warnings to auto-expand', async t => { | ||
await loginAsFoobar(t) | ||
await t | ||
.expect(getUrl()).eql('http://localhost:4002/') | ||
.click(settingsNavButton) | ||
.click(generalSettingsButton) | ||
.click($('#choice-show-all-spoilers')) | ||
.click(homeNavButton) | ||
.expect(getUrl()).eql('http://localhost:4002/') | ||
.expect(getNthStatus(1).exists).ok() | ||
const idx = homeTimeline.findIndex(_ => _.spoiler === 'kitten CW') | ||
await scrollToStatus(t, idx + 1) | ||
await t | ||
.expect(getNthStatusSpoiler(1 + idx).innerText).contains('kitten CW') | ||
.expect(getNthStatus(1 + idx).innerText).contains('here\'s a kitten with a CW') | ||
.click(getNthShowOrHideButton(1 + idx)) | ||
.expect(getNthStatus(1 + idx).innerText).notContains('here\'s a kitten with a CW') | ||
.click(getNthShowOrHideButton(1 + idx)) | ||
.expect(getNthStatus(1 + idx).innerText).contains('here\'s a kitten with a CW') | ||
}) |