summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2021-08-24 11:10:39 +0200
committerJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2021-08-24 11:10:39 +0200
commit2388747fbf954de990862a6c01713d50823e8725 (patch)
treec3b3a7dc80f1d6a978d25e3048f7a6afb9fa08e0 /t
parentbf5554febae6f299c716b5a9582c6bfd6980b728 (diff)
overhauled testing
Diffstat (limited to 't')
-rw-r--r--t/Extract.t6
-rw-r--r--t/Webmail.t8
2 files changed, 8 insertions, 6 deletions
diff --git a/t/Extract.t b/t/Extract.t
index 1d20d0f..5b719da 100644
--- a/t/Extract.t
+++ b/t/Extract.t
@@ -37,7 +37,6 @@ subtest folders => sub {
my $result = decode_json $res[0];
is(@$result, 2);
- ok($_ ~~ ['SUB.FOLDER', 'SENT']) for @$result;
};
subtest count => sub {
@@ -78,7 +77,10 @@ subtest read => sub {
is @res, 1;
my $result = decode_json $res[0];
- is($result->{from}, 'test');
+ is_deeply($result->{from}, [{address => 'shipment-tracking@amazon.de', name => 'Amazon.de'}]);
+ ok($result->{date_received});
+ ok(index($result->{date_received}, '2019-02-22T10:06:54') != -1);
+ like($result->{date_received}, qr'2019-02-22T10:06:54');
};
done_testing;
diff --git a/t/Webmail.t b/t/Webmail.t
index 5409f32..21f0c19 100644
--- a/t/Webmail.t
+++ b/t/Webmail.t
@@ -5,16 +5,16 @@ use utf8;
use Test::More;
use Test::Mojo;
-use JWebmail::Model::Driver::Mock;
+use JWebmail::Model::Driver::MockJSON;
use constant DEFAULT_LANGUAGE => 'en';
-my $user = JWebmail::Model::Driver::Mock::VALID_USER;
-my $pw = JWebmail::Model::Driver::Mock::VALID_PW;
+my $user = JWebmail::Model::Driver::MockJSON::VALID_USER;
+my $pw = JWebmail::Model::Driver::MockJSON::VALID_PW;
my $t = Test::Mojo->new('JWebmail', {
- development => { use_read_mock => 1, block_writes => 1 },
+ development => { use_read_mock => 'json', block_writes => 1 },
i18n => { default_language => 'en' },
});