mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-06-26 16:50:50 +02:00
added test case for qr code
This commit is contained in:
parent
7594939571
commit
531ea1f649
@ -342,6 +342,16 @@ void printProfile(Store node, String profilePubkey) {
|
|||||||
pronoun = "They";
|
pronoun = "They";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print QR code
|
||||||
|
print("The QR code for public key:\n\n");
|
||||||
|
try {
|
||||||
|
print(getQrCodeAsString(profilePubkey));
|
||||||
|
} catch(e) {
|
||||||
|
print("Could not generate qr code. \n");
|
||||||
|
}
|
||||||
|
|
||||||
|
print("");
|
||||||
|
|
||||||
print("\nName : $authorName ( ${profilePubkey} ).");
|
print("\nName : $authorName ( ${profilePubkey} ).");
|
||||||
|
|
||||||
if (profileContactEvent != null ) {
|
if (profileContactEvent != null ) {
|
||||||
@ -356,14 +366,6 @@ void printProfile(Store node, String profilePubkey) {
|
|||||||
print("Nip 05 : ${verified?"yes. ${nip05Id}":"no"}");
|
print("Nip 05 : ${verified?"yes. ${nip05Id}":"no"}");
|
||||||
print("\nLast Updated: ${getPrintableDate(dateLastUpdated)}\n");
|
print("\nLast Updated: ${getPrintableDate(dateLastUpdated)}\n");
|
||||||
|
|
||||||
// print QR code
|
|
||||||
print("The QR code for the public key:\n\n");
|
|
||||||
try {
|
|
||||||
print(getQrCodeAsString(profilePubkey));
|
|
||||||
} catch(e) {
|
|
||||||
print("Could not generate qr code. \n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if( profilePubkey != userPublicKey) {
|
if( profilePubkey != userPublicKey) {
|
||||||
if( profileContactEvent.eventData.contactList.any((x) => (x.id == userPublicKey))) {
|
if( profileContactEvent.eventData.contactList.any((x) => (x.id == userPublicKey))) {
|
||||||
print("* They follow you");
|
print("* They follow you");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:nostr_console/console_ui.dart';
|
||||||
import 'package:nostr_console/event_ds.dart';
|
import 'package:nostr_console/event_ds.dart';
|
||||||
import 'package:nostr_console/settings.dart';
|
import 'package:nostr_console/settings.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
@ -257,6 +258,27 @@ String expectedResult =
|
|||||||
expect(3046, node.getNumMessagesInChannel('25e5c82273a271cb1a840d0060391a0bf4965cafeb029d5ab55350b418953fbb'),
|
expect(3046, node.getNumMessagesInChannel('25e5c82273a271cb1a840d0060391a0bf4965cafeb029d5ab55350b418953fbb'),
|
||||||
reason:'verify a public channel has correct number of messages');
|
reason:'verify a public channel has correct number of messages');
|
||||||
|
|
||||||
|
String qrCodeResult1 =
|
||||||
|
""" █▀▀▀▀▀█ ██▄▄▀ ▄▄ █ ▄▀ █▀▀▀▀▀█
|
||||||
|
█ ███ █ █▄█ ██▄ ▄▄ ██▀▀ █ ███ █
|
||||||
|
█ ▀▀▀ █ ▀ ▀ █▀▄█▄███ ██ █ ▀▀▀ █
|
||||||
|
▀▀▀▀▀▀▀ ▀ ▀▄█ █▄▀ █ █▄█▄▀ ▀▀▀▀▀▀▀
|
||||||
|
█ ▀██▄▀▄▀▄▀ █ ▀ ▀▄█▀██ ▀▄▀▄▄▄█▀▀█
|
||||||
|
▄▄█ ▀▄ ▄▄█ ▀█▀█▀▄ ▄▀▀▄▄▄▀▀▀█▀
|
||||||
|
▄█▄ █▀ █▄ ▀▀▄█▀▀███ ▀▀▄ ▀ ▄▄▄
|
||||||
|
▀ ██▀▀▀ ▀ ▄▄▄ █▀█▄▀ ▄██ ▀▀██▀▀
|
||||||
|
▀█▄▄▀█▄ ▄▀▄▀ ▀ ▄▄▄ █ █▄▄▀▀▀███
|
||||||
|
▄ █▀█▄▀▄▄▄ ▄▀█▄█▀ ▀ ██▀█▀█▄▀█ ▀▄█
|
||||||
|
▄▀▀ ▀▀ █▄▄ ▀▀▄▄▄ ▄▀█▄▄▀ ▄▄ ▄ ▄
|
||||||
|
▄▄▄▀ ▀ ▄█▀█ ▀ ██ █▀█▄ █ ▄▀██ ▀
|
||||||
|
▀ ▀▀▀█▀ ▄▄ █ ▀▀ ▀▀▀ █▀▀▀█ █▄
|
||||||
|
█▀▀▀▀▀█ ▀█▀▄▄▄▀█▀ ▀▀▀█ ▀ █▄██▄
|
||||||
|
█ ███ █ █▄██▀▄▀ ▀▀▀▄▄ ▄▄▀█▀██▄ ██
|
||||||
|
█ ▀▀▀ █ ▀█▀▄ ▄█▀███ ▀ ▄ ▀▀▀▄█ ▀
|
||||||
|
▀▀▀▀▀▀▀ ▀▀▀ ▀▀ ▀ ▀▀ ▀ ▀ \n""";
|
||||||
|
|
||||||
|
String profilePubkey1 = "add06b88bd78c5cbb2cd990e873adfba3eaf8e0217d3208be2be770eb506d430";
|
||||||
|
expect (qrCodeResult1, getQrCodeAsString(profilePubkey1), reason: "testing qr code function");
|
||||||
});
|
});
|
||||||
|
|
||||||
return ;
|
return ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user