pinsTests function

void pinsTests()

Implementation

void pinsTests() {
  acterTestWidget('Create Example Pin with URL can be seen by others',
      (t) async {
    final spaceId = await t.freshAccountWithSpace(
      userDisplayName: 'Alex',
      spaceDisplayName: 'Shared Pins Example',
    );
    await t.createPin(
      spaceId,
      'This is great',
      'This pin contains acter global link',
      'https://acter.global',
    );

    // we expect to be thrown to the pin screen and see our title
    await find.text('This is great').should(findsAtLeast(1));

    final superInviteToken = await t.createSuperInvite([spaceId]);

    await t.logout();
    await t.freshAccount(
      registrationToken: superInviteToken,
      displayName: 'Beatrice',
    );

    await t.navigateTo([
      MainNavKeys.quickJump,
      QuickJumpKeys.pins,
    ]);

    await find.text('This is great').should(findsOneWidget);
  });

  acterTestWidget(
      'Create Example Pin and Edit it with ensuring reflected changes are shown',
      (t) async {
    final spaceId = await t.freshAccountWithSpace(
      userDisplayName: 'Alex',
      spaceDisplayName: 'Pin Edit Example',
    );
    await t.createPin(
      spaceId,
      'Edit Pin Example',
      'This pin contains acter global link',
      'https://acter.global',
    );

    // we expect to be thrown to the pin screen and see our title

    final pinId = await t.editPin(
      'Acter Global website',
      ' and check out our website',
      'https://acter.global',
    );

    // lets re-route to this edited pin to see if changes reflected
    await t.goToPin(pinId);

    await find.text('Acter Global website').should(findsOneWidget);
    await find
        .text('This pin contains acter global link and check out our website')
        .should(findsOneWidget);
    await find.text('https://acter.global').should(findsOneWidget);
  });
}