"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var api_client_1 = __importDefault(require("@/pleroma/api_client")); var notification_1 = __importDefault(require("@/notification")); var notification_2 = __importDefault(require("@/pleroma/notification")); var account = { id: '1', username: 'h3poteto', acct: 'h3poteto@pleroma.io', display_name: 'h3poteto', locked: false, created_at: '2019-03-26T21:30:32', followers_count: 10, following_count: 10, statuses_count: 100, note: 'engineer', url: 'https://pleroma.io', avatar: '', avatar_static: '', header: '', header_static: '', emojis: [], moved: null, fields: [], bot: false }; describe('api_client', function () { describe('notification', function () { describe('encode', function () { it('megalodon notification type should be encoded to pleroma notification type', function () { var cases = [ { src: notification_1.default.Follow, dist: notification_2.default.Follow }, { src: notification_1.default.Favourite, dist: notification_2.default.Favourite }, { src: notification_1.default.Reblog, dist: notification_2.default.Reblog }, { src: notification_1.default.Mention, dist: notification_2.default.Mention }, { src: notification_1.default.PollExpired, dist: notification_2.default.Poll }, { src: notification_1.default.EmojiReaction, dist: notification_2.default.PleromaEmojiReaction }, { src: notification_1.default.FollowRequest, dist: notification_2.default.FollowRequest } ]; cases.forEach(function (c) { expect(api_client_1.default.Converter.encodeNotificationType(c.src)).toEqual(c.dist); }); }); }); describe('decode', function () { it('pleroma notification type should be decoded to megalodon notification type', function () { var cases = [ { src: notification_2.default.Follow, dist: notification_1.default.Follow }, { src: notification_2.default.Favourite, dist: notification_1.default.Favourite }, { src: notification_2.default.Mention, dist: notification_1.default.Mention }, { src: notification_2.default.Reblog, dist: notification_1.default.Reblog }, { src: notification_2.default.Poll, dist: notification_1.default.PollExpired }, { src: notification_2.default.PleromaEmojiReaction, dist: notification_1.default.EmojiReaction }, { src: notification_2.default.FollowRequest, dist: notification_1.default.FollowRequest } ]; cases.forEach(function (c) { expect(api_client_1.default.Converter.decodeNotificationType(c.src)).toEqual(c.dist); }); }); }); }); describe('status', function () { describe('plain content is included', function () { it('plain content in pleroma entity should be exported in plain_content column', function () { var plainContent = 'hoge\nfuga\nfuga'; var content = '
hoge
fuga
fuga
hoge
fuga
fuga