use-ember-get-and-set and model relationships test
See original GitHub issueConsider this code in model unit test:
test('user relationship', function(assert) {
const contact = this.store().modelFor('contact');
const relationship = get(contact, 'relationshipsByName').get('user');
assert.equal(relationship.key, 'user');
assert.equal(relationship.kind, 'belongsTo');
});
This will throw an error because we’re not using Ember.get
getter for the user
property. But we can’t do it because relationshipsByName
is an Ember.Map
which has different get
function.
My first idea was to add some optional settings to this rule where we would define particular preceding properties which shouldn’t throw an error.
I’m almost sure that this won’t be the only case, especially when we’re using some JQuery addons which can also have their own getters
(for example pickadate.js).
WDYT?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
The E&P Relationship Test - Hypnosis Motivation Institute
Taking this test is the first step in your discovery of Dr. John Kappas' revolutionary “E&P” model explaining how our subconscious mind dictates...
Read more >Topic 3: Use Functions to Model Relationships Quiz - Quizizz
Play this game to review Pre-algebra. Does the relation represent a function? (1, 3), (2, 5), (3, 7), (4, 9)
Read more >Attachment Style Quiz: Free & Fast Attachment Style Test
Free and quick (5 minutes) attachment style quiz to explore how childhood conditioning can cause you to struggle with adult relationships.
Read more >Relationship Attachment Style Test - Psychology Today
The main attachment styles covered in this test are Secure, Anxious-Ambivalent, Dismissive-Avoidant, Fearful-Avoidant, Dependent, and Codependent. Find out what ...
Read more >Quizzes to strengthen your relationships - Love Languages
Quizzes to strengthen your relationships. Join the millions that have discovered the secrets to better relationships. Love Language Quiz ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a use case where I often override mirage routes in a test in order to simulate different API results. For example:
Currently
server.get
throws a linting error. Has there been any discussion about a whitelist functionality or ignoringserver.get
entirely? This is listed in the Mirage docs. My current workaround is to:I think so 😃