Change name depending on url in claim, remove references to existing profile, and add another test

This commit is contained in:
Tyler Beckman 2024-06-18 01:03:33 -04:00 committed by Yarmo Mackenbach
parent ff51fa47e6
commit 907f196446
No known key found for this signature in database
GPG key ID: C248C28D432560ED

View file

@ -18,7 +18,7 @@ limitations under the License.
* @module serviceProviders/pronounspage * @module serviceProviders/pronounspage
* @example * @example
* import { ServiceProviderDefinitions } from 'doipjs'; * import { ServiceProviderDefinitions } from 'doipjs';
* const sp = ServiceProviderDefinitions.data.pronounspage.processURI('https://pronouns.page/@Alice'); * const sp = ServiceProviderDefinitions.data.pronounspage.processURI('https://pronouns.page/@doipjs');
*/ */
import * as E from '../enums.js' import * as E from '../enums.js'
@ -45,7 +45,7 @@ export function processURI (uri) {
return new ServiceProvider({ return new ServiceProvider({
about: { about: {
id: 'pronounspage', id: 'pronounspage',
name: 'pronouns.page', name: match[1],
homepage: 'https://pronouns.page' homepage: 'https://pronouns.page'
}, },
profile: { profile: {
@ -90,35 +90,39 @@ export function processURI (uri) {
export const tests = [ export const tests = [
{ {
uri: 'https://pronouns.page/@Alice', uri: 'https://pronouns.page/@doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://pronouns.page/@Alice#she/her', uri: 'https://pronouns.page/@doipjs#it/its',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://pronouns.page/u/Alice', uri: 'https://pronouns.page/u/doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://nl.pronouns.page/u/Alice', uri: 'https://nl.pronouns.page/u/doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://pronombr.es/@Alice', uri: 'https://lad.pronouns.page/u/doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://pronoms.fr/@Alice', uri: 'https://pronombr.es/@doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://zaimki.pl/@Alice', uri: 'https://pronoms.fr/@doipjs',
shouldMatch: true shouldMatch: true
}, },
{ {
uri: 'https://pronouns.page/Alice', uri: 'https://zaimki.pl/@doipjs',
shouldMatch: true
},
{
uri: 'https://pronouns.page/doipjs',
shouldMatch: false shouldMatch: false
} }
] ]