您最多选择25个主题
主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
24 行
660 B
24 行
660 B
// Tests for the behavior of the links collection
|
|
//
|
|
// https://guide.meteor.com/testing.html
|
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
import { assert } from 'chai';
|
|
import Links from './Links.js';
|
|
|
|
if (Meteor.isServer) {
|
|
describe('links collection', function () {
|
|
it('insert correctly', function () {
|
|
const linkId = Links.insert({
|
|
title: 'meteor homepage',
|
|
url: 'https://www.meteor.com',
|
|
});
|
|
const added = Links.find({ _id: linkId });
|
|
const collectionName = added._getCollectionName();
|
|
const count = added.count();
|
|
|
|
assert.equal(collectionName, 'links');
|
|
assert.equal(count, 1);
|
|
});
|
|
});
|
|
}
|
|
|