Skip to content

Releases: adopted-ember-addons/ember-data-factory-guy

v3.1.7

06 Jul 22:33
Compare
Choose a tag to compare
  • made parseUrl more robust ( was affecting mockLinks update from v.3.1.6 )

v3.1.6

06 Jul 22:14
Compare
Choose a tag to compare
  • Improve mockLinks to handle url with query parameters.
    • links are kind of a black box that you can not touch very easily, and the mockLinks helper allows you to mock a links relationship, but now that works for links with query parameters so life is better again

Example:

    let propertiesLink = '/users/1/properties?dudes=2',
        user           = make('user', {properties: {links: propertiesLink}}),
        json           = buildList('property', 1),
        mockProperties = mockLinks(user, 'properties').returns({json});

      const properties = await user.properties.toArray(); // 1 property model 
  • mockLinks automatically breaks that url apart into the url and query params for you

  • alternatively you could use mock

  mock({url: '/users/1/properties/'}).withParams({dudes: 2}).returns(json);

v3.1.5

03 Jul 11:06
Compare
Choose a tag to compare

Example:

let noUsers1 = makeList('user', 0);  
let noUsers2 = makeList('user', 0, 'with_hats', {name: 'Pat'});

Both of these now correctly give you no users ( empty list )

v3.1.4

26 Jun 10:25
Compare
Choose a tag to compare
  • mock ( used for mocking any url ) can now handle query parameters

Example:

    const type       = 'GET',
          url        = '/api/get-stuff',
          whatsUp    = {whats: 'up'},
          message    = {message: 'nothing much doc'}

    let theMock = mock({url}).withParams(whatsUp).returns(message);
    let json = await Ember.$.ajax({type, url, data: whatsUp});
    json // => {message: 'nothing much doc'}

v3.1.3

31 May 20:34
Compare
Choose a tag to compare
  • fixes #344 to pass in request body when matching mockUpdates with function @roschaefer
    mockCreate('project').match(requestBody => {
      return requestBody.data.attributes.title === 'titleToMatch';
    });

v3.1.2

15 May 14:18
Compare
Choose a tag to compare
  • setting query params before handler sets up url to fix #343

v3.1.1

29 Apr 18:47
Compare
Choose a tag to compare

v3.1.0

11 Apr 12:05
Compare
Choose a tag to compare
  • bump ember source/ data / cli to 3.1

v3.0.3

11 Apr 12:04
Compare
Choose a tag to compare
  • fixes #337 by clarifying that mockFindAll can have query params and they will be used first like mockQuery will when the request has query params

Example:

  let mockF   = mockFindAll('user', 2),
      mockFQ  = mockFindAll('user', 1).withParams({foo: true}),
      mockQ   = mockQuery('user', {moo: true});

  store.findAll('user') // mockF used
  store.findAll('user'})  //  with url  "/users?foo=true"  mockFQ used
  store.query('user', {foo: true}) // mockFQ used
  store.query('user', {moo: true}) // mockQ used

v3.0.2

12 Mar 22:48
Compare
Choose a tag to compare
  • fixed issue where relationships did not have parentType, that was introduced in 3.0.1