beforeEach((done) => {
    fixture = TestBed.createComponent(TopbarHashtagsComponent);

    topbarHashtagsServiceMock.loadResponse = [
      {
        value: 'hashtag1',
        selected: true
      },
      {
        value: 'hashtag2',
        selected: false
      }
    ];

    comp = fixture.componentInstance;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        fixture.detectChanges();
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    clientMock.response = {};
    clientMock.response[`api/v2/blockchain/rewards/verify`] = {
      "status": "success",
      "secret": "0",
    };
    clientMock.response[`api/v2/blockchain/rewards/confirm`] = {
      "status": "success",
      "secret": "0",
    };
    fixture = TestBed.createComponent(TokenRewardsOnboardingComponent);
    comp = fixture.componentInstance;
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(WalletTokenContributionsOverviewComponent);
    clientMock.response = {};
    clientMock.response[`api/v2/blockchain/contributions/overview`] = {
      "status": "success",
      "nextPayout": 35478,
      "currentReward": "0",
      "yourContribution": 0,
      "totalNetworkContribution": 173525,
      "yourShare": 0
    };

    comp = fixture.componentInstance;
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
Example #4
0
  beforeEach((done) => {
    jasmine.clock().install();
    fixture = TestBed.createComponent(GroupsProfileMembersInvite);

    comp = fixture.componentInstance;

    comp.group = {
      guid: 123
    };

    window.Minds.cdn_url = 'http://dev.minds.io/';

    clientMock.response = {};

    comp._group = {
      guid: '1234',
      name: 'test group',
      membership: 0,
      'is:owner': true,
      'is:member': true,
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        fixture.detectChanges();
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(WalletBalanceTokensComponent);

    comp = fixture.componentInstance; // WalletBalanceTokensComponent test instance
    clientMock.response = {};
    clientMock.response[`api/v2/blockchain/wallet/balance`] = {
      'status': 'success',
      'balance': 301529,
      'addresses': [
        {
          'label': 'Receiver',
          'address': '0xreceiver',
          'balance': 9000000000000000000,
        },
        {
          'label': 'OffChain',
          'address': '0xoffchain',
          'balance': 9000000000000000000,
        }
      ]
    };
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ReportConsoleComponent);
    clientMock.response = {};
    fixture.detectChanges();
    comp = fixture.componentInstance;
    appeals = [];
    clientMock.response[ `api/v1/entities/report/appeal/review` ] = {
      "status":"success",
      "load-next":'',
      "data":[
        {"guid":"756593195889987599","entity_guid":"755121974073626627", "entityObj": { "type" : "comment"} },
        {"guid":"756593195889987599","entity_guid":"755121974073626627", "entityObj": { "type" : "comment"} },
        {"guid":"756593195889987599","entity_guid":"755121974073626627", "entityObj": { "type" : "comment"} }
      ]
    };

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(NotificationComponent);
    comp = fixture.componentInstance;
    comp.notification = {
      "type":"notification",
      "guid":"843204301747658770",
      "notification_view":"group_activity",
      'entityObj': {
        'title': 'aaaaaaaaaaa'
      },
      "fromObj": {
        name: 'name'
      },
      "params" : {
        group: {},
        time_created: 2222,
        bid: 10
      }
    };
    fixture.detectChanges();
    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(NotificationsComponent);
    clientMock.response = {};

    window.Minds.notifications_count = 10;
    clientMock.response[`api/v1/notifications/all`] = {
      'status': 'success',
      'notifications' : [
        {"type":"notification","guid":"843204301747658770","notification_view":"group_activity"},
        {"type":"notification","guid":"843204301747658770","notification_view":"group_activity"},
        {"type":"notification","guid":"843204301747658770","notification_view":"group_activity"}
      ]
    };
    comp = fixture.componentInstance;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
Example #9
0
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ChannelFeedComponent);
    clientMock.response = {};
    comp = fixture.componentInstance;
    comp.user = { 
        guid: 'guidguid', 
        name: 'name', 
        username: 'username', 
        icontime: 11111, 
        subscribers_count:182, 
        impressions:18200, 
        pinned_posts: ['a', 'b', 'c']
    };
    comp.feed = [ {guid: 'aaaa'}, {guid: 'aaaa'}, {guid: 'aaaa'}, {guid: 'aaaa'}];
    comp.openWireModal = false;
    fixture.detectChanges();

    clientMock.response[`api/v1/newsfeed/personal/1000`] = {
        'status': 'success',
        'load-next': 'aaaa',
        'pinned' : [{guid: 'aaa3a'}],
        'activity' : [ {guid: 'aaa3a'}, {guid: 'aaaa'}, {guid: 'aaaa'}, {guid: 'aaaa'}, {guid: 'aaaa'}]
    };
    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 2;
    jasmine.clock().install();

    fixture = TestBed.createComponent(BlogTileComponent);

    comp = fixture.componentInstance;

    comp.setEntity = {
      guid: '1',
      title: 'title',
      time_created: 1525865293,
      thumbnail_src: 'link/to/thumbnail',
      excerpt: 'this is an excerpt',
      ownerObj: {
        guid: '2',
        username: 'testowner',
        icontime: 1525865293,
      }
    };

    sessionMock.user.admin = false;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable()
        .then(() => {
          fixture.detectChanges();
          done()
        });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(WalletOverviewComponent);

    comp = fixture.componentInstance; // WalletBalanceTokensComponent test instance
    clientMock.response = {};
    clientMock.response[`api/v1/monetization/revenue/overview`] = {
      'status': 'success',
      'balance': 301529,
      total : {
        net: 1
      }
    };
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
Example #12
0
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ChannelSubscribers);
    clientMock.response = {};
    comp = fixture.componentInstance;
    comp.channel = {
      guid: 'guid',
      name: 'name',
      username: 'username',
      icontime: 11111,
      subscribers_count: 182,
      impressions: 18200,
      pinned_posts: ['a', 'b', 'c']
    };

    clientMock.response[`api/v1/subscribe/subscribers/guid`] = {
      'status': 'success',
      'users': [{}, {}, {}]
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ChannelComponent);
    clientMock.response = {};
    uploadMock.response = {};
    comp = fixture.componentInstance;
    comp.username = 'username';
    comp.user = { guid: 'guidguid', name: 'name', username: 'username', icontime: 11111, subscribers_count:182, impressions:18200};
    comp.editing = false;
    fixture.detectChanges();

    clientMock.response[`api/v1/channel/username`] = {
      'status': 'success',
      'channel' : { guid: 'guidguid', name: 'name', username: 'username', icontime: 11111, subscribers_count:182, impressions:18200}
    };

    clientMock.response['api/v1/channel/info'] = {status: 'success'};
    
    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    fixture = TestBed.createComponent(ChannelsListComponent);

    comp = fixture.componentInstance;

    clientMock.response = {};
    clientMock.response['api/v1/entities/trending/channels'] = {
      status: 'success',
      entities: [
        {
          guid: 123,
          name: 'test1'
        },
        {
          guid: 456,
          name: 'test2'
        },
      ]
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        fixture.detectChanges();
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(BanModalComponent);
    clientMock.response = {};

    comp = fixture.componentInstance;

    //set the user
    comp.data = {
      'guid': '1',
      'type': 'user',
      'name': 'test',
      'username': 'test',
      'language': 'en',
      'banned': 'no',
      'city': 'Parana',
      'merchant': false,
      'boostProPlus': false,
      'fb': false,
      'mature': 1,
      'monetized': '',
      'signup_method': false,
      'feature_flags': false,
      'programs': [],
      'plus': false,
      'verified': true,
      'disabled_boost': false,
      'wire_rewards': null,
      'chat': true,
      'subscribed': false,
      'subscriber': false,
      'subscribers_count': 73,
      'subscriptions_count': 29,
      'impressions': 14761,
      'boost_rating': '2'
    };
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(TokenCompletedOnboardingComponent);
    comp = fixture.componentInstance;
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.clock().install();
    fixture = TestBed.createComponent(BoostPublisherPayoutsComponent);

    comp = fixture.componentInstance;

    clientMock.response = {};

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }

  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ReportCreatorComponent);
    clientMock.response = {};
    fixture.detectChanges();
    comp = fixture.componentInstance;
    comp.guid = '1';

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().install();

    fixture = TestBed.createComponent(SettingsGeneralComponent);

    comp = fixture.componentInstance;

    clientMock.response = {};
    clientMock.response['api/v1/settings/'] = {
      status: 'success',
      channel: {
        guid: '1000',
        name: '',
        email: 'test@minds.com',
        mature: 0,
        disabled_emails: 0,
        selectedCategories: ['art', 'comedy'],
        open_sessions: 1,
      },
      thirdpartynetworks: []
    };

    window.Minds.user = {
      "guid": "1000",
      "type": "user",
      "signup_method": false,
    };

    window.Minds.categories = {
      art: 'Art',
      animals: 'Animals'
    };


    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable()
        .then(() => done());
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 2;
    jasmine.clock().install();

    fixture = TestBed.createComponent(BlogListComponent);

    comp = fixture.componentInstance;
    comp.filter = 'trending';

    clientMock.response = {};
    clientMock.response['api/v1/blog/trending/'] = {
      status: 'success',
      entities: [
        {
          guid: '1',
          type: 'blog'
        },
        {
          guid: '2',
          type: 'blog'
        },
        {
          guid: '3',
          type: 'blog'
        },
        {
          guid: '4',
          type: 'blog'
        },
      ]
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable()
        .then(() => {
          fixture.detectChanges();
          done()
        });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 2;

    fixture = TestBed.createComponent(BlockchainConsoleComponent);

    comp = fixture.componentInstance;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable()
        .then(() => {
          fixture.detectChanges();
          done()
        });
    }
  });
  beforeEach((done) => {

    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ChannelSocialProfiles);
    clientMock.response = {};

    comp = fixture.componentInstance;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();

    fixture = TestBed.createComponent(SearchBarSuggestionsComponent);
    comp = fixture.componentInstance;

    spyOn(comp.session, 'getLoggedInUser').and.returnValue({ guid: 1234 });

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(WalletBalanceRewardsComponent);

    comp = fixture.componentInstance; // WalletBalanceTokensComponent test instance
    clientMock.response = {};
    clientMock.response[`api/v2/blockchain/rewards/balance`] = {
      'status': 'success',
      'balance': 301529,
    };
    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
 beforeEach((done) => {
   
   window.addEventListener = ()=>{};
   jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
   jasmine.clock().uninstall();
   jasmine.clock().install();
   fixture = TestBed.createComponent(MindsVideoQualitySelector);
   comp = fixture.componentInstance;
   comp.qualities = [
     '720',
     '360',
     '128',
   ];
   fixture.detectChanges();
   if (fixture.isStable()) {
     done();
   } else {
     fixture.whenStable().then(() => {
       done();
     });
   }
 });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(ConfirmPasswordModalComponent);

    comp = fixture.componentInstance; // LoginForm test instance
    clientMock.response = {};
    clientMock.response[`api/v2/settings/password/validate`] = {
      'status': 'success',
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(HashtagsSelectorModalComponent);

    comp = fixture.componentInstance;

    topbarHashtagsServiceMock.loadResponse = [
      {
        value: 'thegreatmigration',
        selected: true,
      },
      {
        value: 'thegreatmigration',
        selected: true,
      },
      {
        value: 'thegreatmigration',
        selected: true,
      },
      {
        value: 'thegreatmigration',
        selected: true,
      }];

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        fixture.detectChanges();
        done();
      });
    }
  });
  beforeEach((done) => {
    fixture = TestBed.createComponent(BoostPublisherEarningsComponent);

    comp = fixture.componentInstance;

    clientMock.response = {};

    clientMock.response['api/v2/boost/sums'] = {
      sums: {
        total_count: 3,
        total_earnings: 200,

        token_earnings: 200,
        token_count: 3,

        usd_earnings: 0,
        usd_count: 0,

        points_earnings: 0,
        points_count: 0,
      }
    };

    comp.filter = 'earnings';

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        fixture.detectChanges();
        done();
      });
    }

  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 2;
    jasmine.clock().install();

    fixture = TestBed.createComponent(BoostConsoleBooster);

    comp = fixture.componentInstance;

    clientMock.response = {};
    clientMock.response['api/v1/newsfeed/personal'] = {
      status: 'success',
      activity: [
        { guid: '123' },
        { guid: '456' },
      ]
    };

    clientMock.response['api/v1/entities/owner'] = {
      status: 'success',
      entities: [
        { guid: '789' },
        { guid: '101112' },
      ]
    };

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable()
        .then(() => {
          fixture.detectChanges();
          done()
        });
    }
  });
  beforeEach((done) => {
    jasmine.MAX_PRETTY_PRINT_DEPTH = 10;
    jasmine.clock().uninstall();
    jasmine.clock().install();
    fixture = TestBed.createComponent(NewsfeedSingleComponent);

    comp = fixture.componentInstance; // NewsfeedSingleComponent test instance

    clientMock.response = {};

    clientMock.response['api/v1/newsfeed/single/123'] = {
      'status': 'success',
      "activity": {
        "guid": "123",
        "type": "activity",
        "time_created": "1525415052",
        "time_updated": "1525415052",
        "container_guid": "1234",
        "owner_guid": "1234",
        "access_id": "2",
        "message": "i'm a message",
        "ownerObj": {},
      }
    };

    sessionMock.user.admin = false;

    fixture.detectChanges();

    if (fixture.isStable()) {
      done();
    } else {
      fixture.whenStable().then(() => {
        done();
      });
    }
  });