<commit_before>import {
  Actions,
  Message,
  DraftHelpers,
  SyncbackDraftFilesTask,
} from 'nylas-exports';

describe('DraftHelpers', function describeBlock() {
  describe('prepareDraftForSyncback', () => {
    beforeEach(() => {
      spyOn(DraftHelpers, 'applyExtensionTransformsToDraft').andCallFake((draft) => Promise.resolve(draft))
      spyOn(Actions, 'queueTask')
    });

    it('queues tasks to upload files and send the draft', () => {
      const draft = new Message({
        clientId: "local-123",
        threadId: "thread-123",
        uploads: ['stub'],
      });
      const session = {
        ensureCorrectAccount() { return Promise.resolve() },
        draft() { return draft },
      }
      runs(() => {
        DraftHelpers.prepareDraftForSyncback(session);
      });
      waitsFor(() => Actions.queueTask.calls.length > 0);
      runs(() => {
        const saveAttachments = Actions.queueTask.calls[0].args[0];
        expect(saveAttachments instanceof SyncbackDraftFilesTask).toBe(true);
        expect(saveAttachments.draftClientId).toBe(draft.clientId);
      });
    });
  });

  fdescribe('shouldAppendQuotedText', () => {
    it('returns true if message is reply and has no marker', () => {
      const draft = {
        replyToMessageId: 1,
        body: `<div>hello!</div>`,
      }
      expect(DraftHelpers.shouldAppendQuotedText(draft)).toBe(true)
    })

    it('returns false if message is reply and has marker', () => {<commit_msg>Re-enable all tests by unfocusing the test suite (#2667)<commit_after>import {
  Actions,
  Message,
  DraftHelpers,
  SyncbackDraftFilesTask,
} from 'nylas-exports';

describe('DraftHelpers', function describeBlock() {
  describe('prepareDraftForSyncback', () => {
    beforeEach(() => {
      spyOn(DraftHelpers, 'applyExtensionTransformsToDraft').andCallFake((draft) => Promise.resolve(draft))
      spyOn(Actions, 'queueTask')
    });

    it('queues tasks to upload files and send the draft', () => {
      const draft = new Message({
        clientId: "local-123",
        threadId: "thread-123",
        uploads: ['stub'],
      });
      const session = {
        ensureCorrectAccount() { return Promise.resolve() },
        draft() { return draft },
      }
      runs(() => {
        DraftHelpers.prepareDraftForSyncback(session);
      });
      waitsFor(() => Actions.queueTask.calls.length > 0);
      runs(() => {
        const saveAttachments = Actions.queueTask.calls[0].args[0];
        expect(saveAttachments instanceof SyncbackDraftFilesTask).toBe(true);
        expect(saveAttachments.draftClientId).toBe(draft.clientId);
      });
    });
  });

  describe('shouldAppendQuotedText', () => {
    it('returns true if message is reply and has no marker', () => {
      const draft = {
        replyToMessageId: 1,
        body: `<div>hello!</div>`,
      }
      expect(DraftHelpers.shouldAppendQuotedText(draft)).toBe(true)
    })

    it('returns false if message is reply and has marker', () => {
{'fraction_non_alphanumeric': 0.14772727272727273, 'fraction_numerical': 0.008021390374331552, 'mean_word_length': 3.0228494623655915, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4650098', 'n_tokens_mistral': 911, 'n_tokens_neox': 899, 'n_words': 176}