{"size": 764, "ext": "js", "max_stars_repo_path": "back/test/use_cases/delete-article.spec.js", "max_stars_repo_name": "trollepierre/recontact_travel_blog", "max_stars_repo_stars_event_min_datetime": "2017-11-20T18:16:15.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-04T01:21:10.000Z", "max_issues_repo_path": "back/test/use_cases/delete-article.spec.js", "max_issues_repo_name": "trollepierre/recontact_travel_blog", "max_issues_repo_issues_event_min_datetime": "2017-07-23T22:12:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-16T10:53:20.000Z", "max_forks_repo_path": "back/test/use_cases/delete-article.spec.js", "max_forks_repo_name": "trollepierre/recontact_travel_blog", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 400, "max_forks_count": null, "avg_line_length": 29.3846153846, "max_line_length": 83, "alphanum_fraction": 0.6897905759}
import { expect, sinon } from '../test-helper'
import DeleteArticle from '../../src/use_cases/delete-article'
import ArticleRepository from '../../src/domain/repositories/article-repository'

describe('Unit | DeleteArticle | deleteArticle', () => {
  beforeEach(() => {
    sinon.stub(ArticleRepository, 'deleteByDropboxId').resolves({})
  })

  afterEach(() => {
    ArticleRepository.deleteByDropboxId.restore()
  })

  it('should call ArticleRepository to deleteByDropboxId and return empty', () => {
    // when
    const promise = DeleteArticle.deleteArticle()

    // then
    expect(ArticleRepository.deleteByDropboxId).to.have.been.calledWith()
    return promise.then(returnedArticles => {
      expect(returnedArticles).to.deep.equal({})
    })
  })
})

