Skip to content

Most test fails when updating from 2.0.6 to 2.0.7 #379

Description

@hexadecy

Error: Assertion Failed: Cannot create a new tag for <(unknown):ember922> after it has been destroyed.

test:

import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import StorageObject from 'ember-local-storage/local/object';
import resetStorages from 'ember-local-storage/test-support/reset-storage';

module('Unit | Services | UserOptionsDestroyer', function (hooks) {
  setupTest(hooks);

  module('upon a successful user options object destruction', function (hooks) {
    hooks.beforeEach(function () {
      const mockStorage = StorageObject.extend();

      mockStorage.reopenClass({
        initialState() {
          return {
            userId: '1',
          };
        },
      });

      this.owner.register('storage:userOptions', mockStorage);
    });

    hooks.afterEach(function () {
      window.localStorage.clear();
      resetStorages();
    });

    test('should return a positive response', async function (assert) {
      assert.expect(1);

      const service = this.owner.lookup('service:destroyers/user-options-destroyer');

      const response = await service.destroyOptions();

      const expectedServiceResponse = { success: true, result: null };

      assert.deepEqual(response, expectedServiceResponse);
    });
  });
});

Related to #377

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions