Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ueman committed Jul 30, 2024
1 parent eed4515 commit cc9b821
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
6 changes: 3 additions & 3 deletions apple_passkit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.0+1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -271,5 +271,5 @@ packages:
source: hosted
version: "3.0.3"
sdks:
dart: ">=3.4.3 <4.0.0"
flutter: ">=3.22.2"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
21 changes: 17 additions & 4 deletions passkit/test/pkpass/event_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,41 @@ void main() {
test('can read Event sample pass', () async {
final bytes = loadSample(PassType.eventTicket);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.serialNumber, 'nmyuxofgna');
});

test('has correct type', () async {
final bytes = loadSample(PassType.eventTicket);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.type, PassType.eventTicket);
});

test('has correct type property', () async {
final bytes = loadSample(PassType.eventTicket);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.eventTicket, isNotNull);
});

test('has correct images', () async {
final bytes = loadSample(PassType.eventTicket);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(bytes,
skipChecksumVerification: true, skipSignatureVerification: true);
expect(pkPass.background, isNotNull);
expect(pkPass.background?.image1, isNotNull);
expect(pkPass.background?.image2, isNotNull);
Expand Down
24 changes: 20 additions & 4 deletions passkit/test/pkpass/read_pass_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,44 @@ void main() {
test('can read Event sample pass', () async {
final bytes = loadSample(PassType.eventTicket);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.serialNumber, 'nmyuxofgna');
});

test('can read Coupon sample pass', () async {
final bytes = loadSample(PassType.coupon);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.serialNumber, 'E5982H-I2');
});

test('can read StoreCard sample pass', () async {
final bytes = loadSample(PassType.storeCard);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.serialNumber, 'p69f2J');
});

test('can read Generic sample pass', () async {
final bytes = loadSample(PassType.generic);

final pkPass = PkPass.fromBytes(bytes);
final pkPass = PkPass.fromBytes(
bytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
expect(pkPass.pass.serialNumber, '8j23fm3');
});
}
4 changes: 2 additions & 2 deletions passkit_ui/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ packages:
path: "../../passkit"
relative: true
source: path
version: "0.0.4"
version: "0.0.5"
passkit_ui:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.3"
version: "0.0.4"
path:
dependency: transitive
description:
Expand Down

0 comments on commit cc9b821

Please sign in to comment.