Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
matrix-appservice-discord
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
matrix-appservice-discord
Validations
c51e24c0
Valider
c51e24c0
rédigé
7 years ago
par
Will Hunt
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix linting
parent
0bcbe453
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/db/dbdataemoji.ts
+3
-3
3 ajouts, 3 suppressions
src/db/dbdataemoji.ts
test/test_store.ts
+29
-29
29 ajouts, 29 suppressions
test/test_store.ts
avec
32 ajouts
et
32 suppressions
src/db/dbdataemoji.ts
+
3
−
3
Voir le fichier @
c51e24c0
...
...
@@ -20,8 +20,8 @@ export class DbGuildEmoji implements IDbData {
WHERE emoji_id = $id`
,
{
$id
:
params
.
emoji_id
,
}).
then
((
row
)
=>
{
this
.
Result
=
row
!=
undefined
;
if
(
this
.
Result
)
{
this
.
Result
=
row
!=
=
undefined
;
if
(
this
.
Result
)
{
this
.
EmojiId
=
row
.
emoji_id
;
this
.
GuildId
=
row
.
guild_id
;
this
.
Name
=
row
.
name
;
...
...
@@ -50,7 +50,7 @@ export class DbGuildEmoji implements IDbData {
public
Update
(
store
:
DiscordStore
)
{
// Ensure this has incremented by 1 for Insert+Update operations.
this
.
UpdatedAt
=
new
Date
().
getTime
()
+
1
;
this
.
UpdatedAt
=
new
Date
().
getTime
()
+
1
;
return
store
.
db
.
runAsync
(
`
UPDATE guild_emoji
SET name = $name,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
test/test_store.ts
+
29
−
29
Voir le fichier @
c51e24c0
...
...
@@ -46,43 +46,43 @@ describe("DiscordStore", () => {
return
store
.
Insert
(
emoji
);
})).
to
.
eventually
.
be
.
fulfilled
;
});
it
(
"
should get successfully
"
,
async
function
()
{
it
(
"
should get successfully
"
,
async
()
=>
{
const
store
=
new
DiscordStore
(
"
:memory:
"
);
await
store
.
init
();
const
insert
_e
moji
=
new
DbGuildEmoji
();
insert
_e
moji
.
EmojiId
=
"
123
"
;
insert
_e
moji
.
GuildId
=
"
456
"
;
insert
_e
moji
.
Name
=
"
TestEmoji
"
;
insert
_e
moji
.
MxcUrl
=
"
TestUrl
"
;
await
store
.
Insert
(
insert
_e
moji
);
const
get
_e
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
equal
(
get
_e
moji
.
Name
,
"
TestEmoji
"
);
Chai
.
assert
.
equal
(
get
_e
moji
.
MxcUrl
,
"
TestUrl
"
);
const
insert
E
moji
=
new
DbGuildEmoji
();
insert
E
moji
.
EmojiId
=
"
123
"
;
insert
E
moji
.
GuildId
=
"
456
"
;
insert
E
moji
.
Name
=
"
TestEmoji
"
;
insert
E
moji
.
MxcUrl
=
"
TestUrl
"
;
await
store
.
Insert
(
insert
E
moji
);
const
get
E
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
equal
(
get
E
moji
.
Name
,
"
TestEmoji
"
);
Chai
.
assert
.
equal
(
get
E
moji
.
MxcUrl
,
"
TestUrl
"
);
});
it
(
"
should not return nonexistant emoji
"
,
async
function
()
{
it
(
"
should not return nonexistant emoji
"
,
async
()
=>
{
const
store
=
new
DiscordStore
(
"
:memory:
"
);
await
store
.
init
();
const
get
_e
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
isFalse
(
get
_e
moji
.
Result
);
const
get
E
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
isFalse
(
get
E
moji
.
Result
);
});
it
(
"
should update successfully
"
,
async
function
()
{
it
(
"
should update successfully
"
,
async
()
=>
{
const
store
=
new
DiscordStore
(
"
:memory:
"
);
await
store
.
init
();
const
insert
_e
moji
=
new
DbGuildEmoji
();
insert
_e
moji
.
EmojiId
=
"
123
"
;
insert
_e
moji
.
GuildId
=
"
456
"
;
insert
_e
moji
.
Name
=
"
TestEmoji
"
;
insert
_e
moji
.
MxcUrl
=
"
TestUrl
"
;
await
store
.
Insert
(
insert
_e
moji
);
insert
_e
moji
.
EmojiId
=
"
123
"
;
insert
_e
moji
.
GuildId
=
"
456
"
;
insert
_e
moji
.
Name
=
"
TestEmoji2
"
;
insert
_e
moji
.
MxcUrl
=
"
NewURL
"
;
await
store
.
Update
(
insert
_e
moji
);
const
get
_e
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
equal
(
get
_e
moji
.
Name
,
"
TestEmoji2
"
);
Chai
.
assert
.
equal
(
get
_e
moji
.
MxcUrl
,
"
NewURL
"
);
Chai
.
assert
.
notEqual
(
get
_e
moji
.
CreatedAt
,
get
_e
moji
.
UpdatedAt
);
const
insert
E
moji
=
new
DbGuildEmoji
();
insert
E
moji
.
EmojiId
=
"
123
"
;
insert
E
moji
.
GuildId
=
"
456
"
;
insert
E
moji
.
Name
=
"
TestEmoji
"
;
insert
E
moji
.
MxcUrl
=
"
TestUrl
"
;
await
store
.
Insert
(
insert
E
moji
);
insert
E
moji
.
EmojiId
=
"
123
"
;
insert
E
moji
.
GuildId
=
"
456
"
;
insert
E
moji
.
Name
=
"
TestEmoji2
"
;
insert
E
moji
.
MxcUrl
=
"
NewURL
"
;
await
store
.
Update
(
insert
E
moji
);
const
get
E
moji
=
await
store
.
Get
(
DbGuildEmoji
,
{
emoji_id
:
"
123
"
});
Chai
.
assert
.
equal
(
get
E
moji
.
Name
,
"
TestEmoji2
"
);
Chai
.
assert
.
equal
(
get
E
moji
.
MxcUrl
,
"
NewURL
"
);
Chai
.
assert
.
notEqual
(
get
E
moji
.
CreatedAt
,
get
E
moji
.
UpdatedAt
);
});
});
});
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter