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: '******', 
        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: '******',
        icontime: 1525865293,
      }
    };

    sessionMock.user.admin = false;

    fixture.detectChanges();

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