mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(flags): move reply flag below link and auto-geo on /bant/
Hide the flag selector on /bant/ while still publishing geographic location, and place the reply modal flag field after the link field.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getCommentFlagOptionsForDirectory, getCommentFlagPublishOptionsFromSelection, getCommentFlagRequestFromSelection } from '../comment-flag-selection';
|
||||
import {
|
||||
getCommentFlagOptionsForDirectory,
|
||||
getCommentFlagPublishOptionsForDirectory,
|
||||
getCommentFlagPublishOptionsFromSelection,
|
||||
getCommentFlagRequestFromSelection,
|
||||
} from '../comment-flag-selection';
|
||||
|
||||
describe('comment-flag-selection', () => {
|
||||
it('does not expose options for boards without flags', () => {
|
||||
@@ -16,6 +21,29 @@ describe('comment-flag-selection', () => {
|
||||
).toEqual([{ label: 'Geographic Location', value: 'country:auto' }]);
|
||||
});
|
||||
|
||||
it('does not expose a flag selector on /bant/ but still publishes geographic location', () => {
|
||||
expect(
|
||||
getCommentFlagOptionsForDirectory({
|
||||
directoryCode: 'bant',
|
||||
features: { hasFlags: true },
|
||||
title: '/bant/ - International/Random',
|
||||
}),
|
||||
).toEqual([]);
|
||||
|
||||
expect(
|
||||
getCommentFlagPublishOptionsForDirectory({
|
||||
directoryCode: 'bant',
|
||||
features: { hasFlags: true },
|
||||
title: '/bant/ - International/Random',
|
||||
}),
|
||||
).toEqual({
|
||||
challengeRequest: {
|
||||
challengeAnswers: ['bitsocial-flags:5chan:flag:country:auto'],
|
||||
},
|
||||
flairs: [{ type: 'country', code: 'auto', text: 'flag:country:auto' }],
|
||||
});
|
||||
});
|
||||
|
||||
it('matches the 4chan /pol/ flag order', () => {
|
||||
const options = getCommentFlagOptionsForDirectory({
|
||||
directoryCode: 'pol',
|
||||
|
||||
Reference in New Issue
Block a user