Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
robinhoodie0823 committed Nov 19, 2023
1 parent 7b61060 commit a606b2a
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/app/store/useTokens.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,22 @@ describe('useToken test', () => {
});
});

// it('handleRemap test', async () => {
// const messageSpy = jest.spyOn(AsyncMessageChannel.ReactInstance, 'message');
// await act(async () => {
// await result.current.handleRemap(TokenTypes.SIZING, 'sizing.small', 'sizing.sm', [{ name: 'sizing.small', value: 3, type: TokenTypes.SIZING }]);
// });

// expect(messageSpy).toBeCalledWith({
// type: AsyncMessageTypes.REMAP_TOKENS,
// category: TokenTypes.SIZING,
// oldName: 'sizing.small',
// newName: 'sizing.sm',
// updateMode: UpdateMode.SELECTION,
// tokens: [{ name: 'sizing.small', value: 3, type: TokenTypes.SIZING }],
// settings: store.getState().settings,
// });
// });
it('handleRemap test', async () => {
const messageSpy = jest.spyOn(AsyncMessageChannel.ReactInstance, 'message');
await act(async () => {
await result.current.handleRemap(TokenTypes.SIZING, 'sizing.small', 'sizing.sm', [{ name: 'sizing.small', value: 3, type: TokenTypes.SIZING }]);
});

expect(messageSpy).toBeCalledWith({
type: AsyncMessageTypes.REMAP_TOKENS,
category: TokenTypes.SIZING,
oldName: 'sizing.small',
newName: 'sizing.sm',
updateMode: UpdateMode.SELECTION,
tokens: [{ name: 'sizing.small', value: 3, type: TokenTypes.SIZING }],
settings: store.getState().settings,
});
});

it('remapToken test', async () => {
const messageSpy = jest.spyOn(AsyncMessageChannel.ReactInstance, 'message');
Expand All @@ -339,19 +339,19 @@ describe('useToken test', () => {
});
});

// it('remapTokensInGroup', async () => {
// const messageSpy = jest.spyOn(AsyncMessageChannel.ReactInstance, 'message');
// mockConfirm.mockImplementation(() => Promise.resolve({ data: ['selection'], result: true }));
// await act(async () => {
// await result.current.remapTokensInGroup({ oldGroupName: 'old.', newGroupName: 'new.' });
// });
// expect(messageSpy).toBeCalledWith({
// type: AsyncMessageTypes.BULK_REMAP_TOKENS,
// oldName: 'old.',
// newName: 'new.',
// updateMode: UpdateMode.SELECTION,
// });
// });
it('remapTokensInGroup', async () => {
const messageSpy = jest.spyOn(AsyncMessageChannel.ReactInstance, 'message');
mockConfirm.mockImplementation(() => Promise.resolve({ data: ['selection'], result: true }));
await act(async () => {
await result.current.remapTokensInGroup({ oldGroupName: 'old.', newGroupName: 'new.' });
});
expect(messageSpy).toBeCalledWith({
type: AsyncMessageTypes.BULK_REMAP_TOKENS,
oldName: 'old.',
newName: 'new.',
updateMode: UpdateMode.SELECTION,
});
});

describe('createStylesFromTokens', () => {
const tokenMockStore = createMockStore({
Expand Down

0 comments on commit a606b2a

Please sign in to comment.