Skip to content

Commit

Permalink
Rename permission request completed event
Browse files Browse the repository at this point in the history
  • Loading branch information
technoplato committed Mar 26, 2024
1 parent cfc9c9e commit d6505d0
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('permission requester and checker machine', () => {
}),
assignPermissionRequestResultToContext: assign({
permissionsStatuses: ({ event, context }) => {
assertEvent(event, 'permissionRequested');
assertEvent(event, 'permissionRequestCompleted');
return {
...context.permissionsStatuses,
[event.permission]: event.status,
Expand All @@ -135,7 +135,7 @@ describe('permission requester and checker machine', () => {
),
},
}).createMachine({
/** @xstate-layout N4IgpgJg5mDOIC5QCMCWUDSBDAFgVwDssA6LABzIBtUBjLAF1QHsCAZVAMzBoE8bKwAYnJVaDZgQBiTAE5goMpoQiQA2gAYAuolBkmsVIxY6QAD0QBaABwBmdcQCcANicAWKwFY7D165tWAGhAeSwBGf2JQgHYbf3U7J38PACYogF80oLRMXEISEWo6IzZObj4BYQpC8RYAISwaAGsFJQIVCA1tJBA9A2KTcwQLVxjHZISoqz9bcI8gkKHwq0iYmydk9Sso9VdQq2SMrPRsfCJiMjAZAFtUWAMWWGFKSgAFS5u7iVgAYRxuRrUWhMvUMEgGiBsrmSxB2ySsVjcoS8O3Uc2CYSs9lCiSi218DiiHnU6gOmRA2ROeXO71u9wIj3oMnQMBkb2utIkv3+nWB+lBxm6g2GTmIu3USJsDmSTn2NiiznmYQcNlFUVCm12UycRI8VkO5OOuTOF3ZnwegkZzMubI+dIASmAAI54OD0HndEH9QWIZLQ4kygkyqwOKa+tELSHQuW48bhX1rJz6ilGkgm21fQRpjksB3O12Arq6Ple0CDOVYjw+Byo-ZWdUORUINbLWyQ4OxLaQjwZMkEJgqeDdZOnLC8vpg71DKUOUWpX1QpybWyBdFDGyV4huBHqdZw5LuRNk4dUgpiYrsLi8fhgMf8gjgobw0KzqLz6VL-yNixz4g2ZIeNVZmJBFXCTQ0R1IKozwkC8ymvSDRCKCQAEl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xlYgPADYDwkhXZKx7NIgA */
id: 'bigKahuna',
type: 'parallel',

Expand Down Expand Up @@ -181,7 +181,7 @@ describe('permission requester and checker machine', () => {
],
},

permissionRequested: {
permissionRequestCompleted: {
actions: 'assignPermissionRequestResultToContext',
},
},
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('permission requester and checker machine', () => {
},
}).createMachine({
on: {
permissionRequested: {
permissionRequestCompleted: {
actions: spy,
},
triggerPermissionRequest: {
Expand Down Expand Up @@ -329,7 +329,7 @@ describe('permission requester and checker machine', () => {

expect(result).not.toBeNull();
expect(result.event).toStrictEqual({
type: 'permissionRequested',
type: 'permissionRequestCompleted',
status: PermissionStatuses.granted,
permission: Permissions.bluetooth,
});
Expand Down Expand Up @@ -397,7 +397,7 @@ export type ParentEvent =
}
| { type: 'triggerPermissionRequest'; permission: Permission }
| {
type: 'permissionRequested';
type: 'permissionRequestCompleted';
status: PermissionStatus;
permission: Permission;
}
Expand Down Expand Up @@ -427,7 +427,7 @@ const permissionCheckerAndRequesterMachine = setup({
return;
}

if (event.type === 'permissionRequested') {
if (event.type === 'permissionRequestCompleted') {
console.log('sending event to parent', event);
}

Expand Down Expand Up @@ -465,7 +465,7 @@ const permissionCheckerAndRequesterMachine = setup({
// console.log(JSON.stringify(event, null, 2));

// return {
// type: 'permissionRequested',
// type: 'permissionRequestCompleted',
// status: event.output.status,
// permission: event.output.permission,
// };
Expand Down Expand Up @@ -553,7 +553,7 @@ const permissionCheckerAndRequesterMachine = setup({
type: 'checkedSendParent',
params({ event }) {
return {
type: 'permissionRequested',
type: 'permissionRequestCompleted',
status: event.output.status,
permission: event.output.permission,
};
Expand Down

0 comments on commit d6505d0

Please sign in to comment.