~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/old-fella

Old people's social media app

0
1
main
106 lines · 2.9 KB Raw History
import Foundation
import XCTest

@testable import OldFella

final class ModerationPreferenceTestState {
    var failDefinitions = false
    var omitLabeler = false
    var malformedDefinitions = false
    var clock = Date(timeIntervalSince1970: 1_700_000_000)
}

enum ModerationPreferenceResponses {
    static let preferences = """
        {
          "preferences": [
            {
              "$type": "app.bsky.actor.defs#adultContentPref",
              "enabled": true
            },
            {
              "$type": "app.bsky.actor.defs#contentLabelPref",
              "label": "nudity",
              "visibility": "hide"
            },
            {
              "$type": "app.bsky.actor.defs#contentLabelPref",
              "labelerDid": "did:plc:labels",
              "label": "custom",
              "visibility": "warn"
            },
            {
              "$type": "app.bsky.actor.defs#labelersPref",
              "labelers": [
                {
                  "did": "did:plc:labels"
                }
              ]
            },
            {
              "$type": "app.bsky.actor.defs#mutedWordsPref",
              "items": [
                {
                  "value": "spoiler",
                  "targets": [
                    "content"
                  ],
                  "actorTarget": "exclude-following"
                }
              ]
            }
          ]
        }
        """

    static let definitions = """
        {
          "views": [
            {
              "uri": "at://did:plc:labels/app.bsky.labeler.service/self",
              "cid": "cid",
              "creator": {
                "did": "did:plc:labels",
                "handle": "labels.example"
              },
              "indexedAt": "2024-05-06T12:34:56Z",
              "policies": {
                "labelValues": [
                  "custom"
                ],
                "labelValueDefinitions": [
                  {
                    "identifier": "custom",
                    "severity": "alert",
                    "blurs": "content",
                    "defaultSetting": "inform",
                    "adultOnly": true,
                    "locales": [
                      {
                        "lang": "en",
                        "name": "Custom",
                        "description": "Custom label"
                      }
                    ]
                  }
                ]
              }
            },
            {
              "uri": "at://did:plc:ar7c4by46qjdydhdevvrndac/app.bsky.labeler.service/self",
              "cid": "cid",
              "creator": {
                "did": "did:plc:ar7c4by46qjdydhdevvrndac",
                "handle": "moderation.bsky.app"
              },
              "indexedAt": "2024-05-06T12:34:56Z",
              "policies": {
                "labelValues": [],
                "labelValueDefinitions": []
              }
            }
          ]
        }
        """

}