mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 22:57:29 +00:00
intent test cases for #1201
This commit is contained in:
parent
5c0598502a
commit
65addf8c92
@ -51,8 +51,6 @@
|
||||
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:host="ig.me" />
|
||||
<data android:host="www.ig.me" />
|
||||
<data android:host="instagr.am" />
|
||||
<data android:host="www.instagr.am" />
|
||||
<data android:host="instagram.com" />
|
||||
@ -60,6 +58,7 @@
|
||||
<data android:pathPrefix="/" />
|
||||
<data android:pathPrefix="/p" />
|
||||
<data android:pathPrefix="/explore/tags" />
|
||||
<data android:pathPrefix="/explore/locations" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
@ -104,14 +103,6 @@
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:host="ig.me" />
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.Login"
|
||||
|
@ -0,0 +1,25 @@
|
||||
package awais.instagrabber.utils;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import awais.instagrabber.models.IntentModel;
|
||||
import awais.instagrabber.models.enums.IntentModelType;
|
||||
|
||||
class IntentUtilsTest {
|
||||
|
||||
@Test
|
||||
void getIntentFromUrl() {
|
||||
IntentModel intent = IntentUtils.parseUrl("https://instagr.am/austinhuang.me");
|
||||
Assertions.assertEquals(new IntentModel(IntentModelType.USERNAME, "austinhuang.me"), intent);
|
||||
intent = IntentUtils.parseUrl("https://www.instagr.am/_u/austinhuang.me");
|
||||
Assertions.assertEquals(new IntentModel(IntentModelType.USERNAME, "austinhuang.me"), intent);
|
||||
intent = IntentUtils.parseUrl("https://instagram.com/p/BmjKdkxjzO7/");
|
||||
Assertions.assertEquals(new IntentModel(IntentModelType.POST, "BmjKdkxjzO7"), intent);
|
||||
intent = IntentUtils.parseUrl("https://www.instagram.com/explore/tags/metrodemontreal/");
|
||||
Assertions.assertEquals(new IntentModel(IntentModelType.HASHTAG, "metrodemontreal"), intent);
|
||||
intent = IntentUtils.parseUrl("http://www.instagram.com/explore/locations/538444610/abcde");
|
||||
Assertions.assertEquals(new IntentModel(IntentModelType.LOCATION, "538444610"), intent);
|
||||
// todo: reel and igtv test cases that are sfw and preferably n i c e
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user