Skip to content

Instantly share code, notes, and snippets.

@rotemmiz
Created February 22, 2018 00:05
Show Gist options
  • Save rotemmiz/7c839c75aa16afff76dc8d06830e6f11 to your computer and use it in GitHub Desktop.
Save rotemmiz/7c839c75aa16afff76dc8d06830e6f11 to your computer and use it in GitHub Desktop.
Detox: A Year in. Building It, Testing With It
it('should send push token to notification server after user allows push permissions', async () => {
appStateServer.forUser(appStateServer.testUserId()).withBusinesses(1);
await device.launchApp({delete: true});
await element(by.text('Log In TestUser1')).tap();
notificationServer.expectLastRegiscribe().toNotExist();
await element(by.text('Allow')).tap();
await expect(element(by.text('feed.FeedScreen'))).toBeVisible();
notificationServer.expectLastRegiscribe().toContain({appleDeviceToken: consts.DeviceToken});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment