<commit_before>import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { IDENTIFIERS } from '@ember-data/canary-features';
import Store from '@ember-data/store';
import { identifierCacheFor } from '@ember-data/store/-private';

if (IDENTIFIERS) {
  module('Integration | Identifiers - cache', function(hooks) {
    setupTest(hooks);
    let store, cache;

    hooks.beforeEach(function() {
      this.owner.register(`service:store`, Store);
      store = this.owner.lookup('service:store');
      cache = identifierCacheFor(store);
    });

    module('getOrCreateRecordIdentifier()', function() {
      test('creates a new resource identifier if forgetRecordIdentifier() has been called on the existing identifier', async function(assert) {
        const runspiredHash = {
          type: 'person',
          id: '1',
          attributes: {
            name: 'runspired',
          },
        };
        const identifier = cache.getOrCreateRecordIdentifier(runspiredHash);

        cache.forgetRecordIdentifier(identifier);

        const regeneratedIdentifier = cache.getOrCreateRecordIdentifier(runspiredHash);

        assert.notEqual(identifier, regeneratedIdentifier, 'a record get a new identifier if identifier get forgotten');
      });

      test('returns the existing identifier when called with an identifier', async function(assert) {
        const houseHash = {
          type: 'house',
          id: '1',
          attributes: {
            name: 'Moomin',
          },
        };
        const cache = identifierCacheFor(store);
        const identifier = cache.getOrCreateRecordIdentifier(houseHash);

        assert.equal(
          identifier,
          cache.getOrCreateRecordIdentifier(identifier),
          'getOrCreateRecordIdentifier() return identifier'
        );
      });
    });
  });
}<commit_msg>[TEST] Use strictEqual for identifiers/cache test (#6488)<commit_after>import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { IDENTIFIERS } from '@ember-data/canary-features';
import Store from '@ember-data/store';
import { identifierCacheFor } from '@ember-data/store/-private';

if (IDENTIFIERS) {
  module('Integration | Identifiers - cache', function(hooks) {
    setupTest(hooks);
    let store, cache;

    hooks.beforeEach(function() {
      this.owner.register(`service:store`, Store);
      store = this.owner.lookup('service:store');
      cache = identifierCacheFor(store);
    });

    module('getOrCreateRecordIdentifier()', function() {
      test('creates a new resource identifier if forgetRecordIdentifier() has been called on the existing identifier', async function(assert) {
        const runspiredHash = {
          type: 'person',
          id: '1',
          attributes: {
            name: 'runspired',
          },
        };
        const identifier = cache.getOrCreateRecordIdentifier(runspiredHash);

        cache.forgetRecordIdentifier(identifier);

        const regeneratedIdentifier = cache.getOrCreateRecordIdentifier(runspiredHash);

        assert.notEqual(identifier, regeneratedIdentifier, 'a record get a new identifier if identifier get forgotten');
      });

      test('returns the existing identifier when called with an identifier', async function(assert) {
        const houseHash = {
          type: 'house',
          id: '1',
          attributes: {
            name: 'Moomin',
          },
        };
        const cache = identifierCacheFor(store);
        const identifier = cache.getOrCreateRecordIdentifier(houseHash);

        assert.strictEqual(
          identifier,
          cache.getOrCreateRecordIdentifier(identifier),
          'getOrCreateRecordIdentifier() return identifier'
        );
      });
    });
  });
}
{'fraction_non_alphanumeric': 0.11246684350132626, 'fraction_numerical': 0.002122015915119363, 'mean_word_length': 2.855828220858896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6078913', 'n_tokens_mistral': 974, 'n_tokens_neox': 958, 'n_words': 238}