Skip to content

Commit

Permalink
chore(tests): fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jdanyow committed Oct 15, 2017
1 parent 1c231ee commit 70b0163
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/composite-observer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ describe('CompositeObserver', () => {
expect(conditionObserver.hasSubscribers()).toBe(true);
expect(yesObserver.hasSubscribers()).toBe(true);
expect(noObserver.hasSubscribers()).toBe(false);
expect(el.id).toBe(obj.yes);
expect(el.textContent).toBe(obj.yes);

obj.condition = false;
setTimeout(() => {
expect(conditionObserver.hasSubscribers()).toBe(true);
expect(yesObserver.hasSubscribers()).toBe(false);
expect(noObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe(obj.no);
expect(el.textContent).toBe(obj.no);
obj.no = 'noooo';

setTimeout(() => {
expect(el.id).toBe(obj.no);
expect(el.textContent).toBe(obj.no);
binding.unbind();
expect(conditionObserver.hasSubscribers()).toBe(false);
expect(yesObserver.hasSubscribers()).toBe(false);
Expand Down Expand Up @@ -80,18 +80,18 @@ describe('CompositeObserver', () => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(false);
expect(cObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe(obj.c.toString());
expect(el.textContent).toBe(obj.c.toString());

obj.a = true;
setTimeout(() => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
expect(cObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe(obj.c.toString());
expect(el.textContent).toBe(obj.c.toString());
obj.b = true;

setTimeout(() => {
expect(el.id).toBe(obj.a.toString());
expect(el.textContent).toBe(obj.a.toString());
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
expect(cObserver.hasSubscribers()).toBe(false);
Expand All @@ -117,12 +117,12 @@ describe('CompositeObserver', () => {

binding.bind(createScopeForTest(obj));
expect(conditionObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe((!obj.condition).toString());
expect(el.textContent).toBe((!obj.condition).toString());

obj.condition = false;
setTimeout(() => {
expect(conditionObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe((!obj.condition).toString());
expect(el.textContent).toBe((!obj.condition).toString());
binding.unbind();
expect(conditionObserver.hasSubscribers()).toBe(false);
document.body.removeChild(el);
Expand All @@ -147,13 +147,13 @@ describe('CompositeObserver', () => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
//expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('ab');
expect(el.textContent).toBe('ab');
obj.a = 'aa';
setTimeout(() => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
//expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('aab');
expect(el.textContent).toBe('aab');

binding.unbind();
expect(aObserver.hasSubscribers()).toBe(false);
Expand Down Expand Up @@ -182,13 +182,13 @@ describe('CompositeObserver', () => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
//expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('ab');
expect(el.textContent).toBe('ab');
obj.a = 'aa';
setTimeout(() => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
//expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('aab');
expect(el.textContent).toBe('aab');

binding.unbind();
expect(aObserver.hasSubscribers()).toBe(false);
Expand Down Expand Up @@ -217,13 +217,13 @@ describe('CompositeObserver', () => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('ab');
expect(el.textContent).toBe('ab');
obj.a = 'aa';
setTimeout(() => {
expect(aObserver.hasSubscribers()).toBe(true);
expect(bObserver.hasSubscribers()).toBe(true);
expect(testObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('aab');
expect(el.textContent).toBe('aab');

binding.unbind();
expect(aObserver.hasSubscribers()).toBe(false);
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('CompositeObserver', () => {
expect(xObserver.hasSubscribers()).toBe(true);
expect(yObserver.hasSubscribers()).toBe(true);
expect(zObserver.hasSubscribers()).toBe(true);
expect(el.id).toBe('true');
expect(el.textContent).toBe('true');
obj.a = 0;
obj.b = 0;
setTimeout(() => {
Expand All @@ -283,7 +283,7 @@ describe('CompositeObserver', () => {
expect(xObserver.hasSubscribers()).toBe(false);
expect(yObserver.hasSubscribers()).toBe(false);
expect(zObserver.hasSubscribers()).toBe(false);
expect(el.id).toBe('false');
expect(el.textContent).toBe('false');
obj.a = true;
obj.b = true;
obj.x = null;
Expand All @@ -298,7 +298,7 @@ describe('CompositeObserver', () => {
expect(xObserver.hasSubscribers()).toBe(true);
expect(yObserver.hasSubscribers()).toBe(false);
expect(zObserver.hasSubscribers()).toBe(false);
expect(el.id).toBe('hello world');
expect(el.textContent).toBe('hello world');

binding.unbind();
expect(objObserver.hasSubscribers()).toBe(false);
Expand Down

0 comments on commit 70b0163

Please sign in to comment.