pulsar/spec/clipboard-spec.js
Sadick 83d6c09b10
Decaffeinate specs (#21546)
Decaffeinate the following files.

* atom-protocol-handler
* babel-spec
* buffered-node-process
* buffered-process
* clipboard
* context-menu-manager
* decoration-manager
* default-directory-provider
* deserializer-manager
* file-system-blob-store
* keymap-extensions
* menu-manager
* module-cache
* pane-axis-element
* pane-container-element
* pane-element
* package-spec
* squirel-update
* styles-element-spec
* task-spec
* typescript-spec
* spec-helper-platform
2020-10-30 16:40:57 +03:00

18 lines
725 B
JavaScript

describe('Clipboard', () =>
describe('write(text, metadata) and read()', function() {
it('writes and reads text to/from the native clipboard', function() {
expect(atom.clipboard.read()).toBe('initial clipboard content');
atom.clipboard.write('next');
expect(atom.clipboard.read()).toBe('next');
});
return it('returns metadata if the item on the native clipboard matches the last written item', function() {
atom.clipboard.write('next', { meta: 'data' });
expect(atom.clipboard.read()).toBe('next');
expect(atom.clipboard.readWithMetadata().text).toBe('next');
expect(atom.clipboard.readWithMetadata().metadata).toEqual({
meta: 'data'
});
});
}));