<commit_before>describe('Catalogs.details', function() {
  beforeEach(function() {
    module('app.states');
  });

  describe('#resolveDialogs', function() {
    var collectionsApiSpy;
    const serviceRequest = false;
    beforeEach(function() {
      bard.inject('$state', '$stateParams', 'CollectionsApi');
      $stateParams.serviceTemplateId = 123;
      collectionsApiSpy = sinon.spy(CollectionsApi, 'query');
    });

    it('should query the API with the correct template id and options', function() {
      var options = {expand: 'resources', attributes: 'content'};
      $state.get('catalogs.details').resolve.dialogs($stateParams, serviceRequest, CollectionsApi);
      expect(collectionsApiSpy).to.have.been.calledWith('service_templates/123/service_dialogs', options);
    });

    it('should query the API for service templates', function() {
      const serviceTemplateSpy = sinon.spy(CollectionsApi, 'get');
      var options = { attributes: "picture,picture.image_href" };
      $state.get('catalogs.details').resolve.serviceTemplate($stateParams, serviceRequest, CollectionsApi);
      expect(serviceTemplateSpy).to.have.been.calledWith('service_templates',123, options);
    });
    it('should query the API for serviceRequest if one is set', () => {
      const serviceRequestSpy = sinon.spy(CollectionsApi, 'get');
      $stateParams.serviceRequestId = 12345;
      const options = {}
      $state.get('catalogs.duplicate').resolve.serviceRequest($stateParams, CollectionsApi);
      expect(serviceRequestSpy).to.have.been.calledWith('requests',12345, options);
    })
  });

  describe('controller', function() {
    var collectionsApiSpy;
    var controller;
    var refreshSingleFieldSpy;<commit_msg>Updated test definition for how attributes are passed to service<commit_after>describe('Catalogs.details', function() {
  beforeEach(function() {
    module('app.states');
  });

  describe('#resolveDialogs', function() {
    var collectionsApiSpy;
    const serviceRequest = false;
    beforeEach(function() {
      bard.inject('$state', '$stateParams', 'CollectionsApi');
      $stateParams.serviceTemplateId = 123;
      collectionsApiSpy = sinon.spy(CollectionsApi, 'query');
    });

    it('should query the API with the correct template id and options', function() {
      var options = {expand: 'resources', attributes: 'content'};
      $state.get('catalogs.details').resolve.dialogs($stateParams, serviceRequest, CollectionsApi);
      expect(collectionsApiSpy).to.have.been.calledWith('service_templates/123/service_dialogs', options);
    });

    it('should query the API for service templates', function() {
      const serviceTemplateSpy = sinon.spy(CollectionsApi, 'get');
      var options = { attributes: ['picture','picture.image_href'] };
      $state.get('catalogs.details').resolve.serviceTemplate($stateParams, serviceRequest, CollectionsApi);
      expect(serviceTemplateSpy).to.have.been.calledWith('service_templates',123, options);
    });
    it('should query the API for serviceRequest if one is set', () => {
      const serviceRequestSpy = sinon.spy(CollectionsApi, 'get');
      $stateParams.serviceRequestId = 12345;
      const options = {}
      $state.get('catalogs.duplicate').resolve.serviceRequest($stateParams, CollectionsApi);
      expect(serviceRequestSpy).to.have.been.calledWith('requests',12345, options);
    })
  });

  describe('controller', function() {
    var collectionsApiSpy;
    var controller;
    var refreshSingleFieldSpy;
{'fraction_non_alphanumeric': 0.13743940690048476, 'fraction_numerical': 0.010835471913316224, 'mean_word_length': 4.464174454828661, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1214076', 'n_tokens_mistral': 1000, 'n_tokens_neox': 952, 'n_words': 196}