您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
25 行
660 B
25 行
660 B
4 年前
|
// 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);
|
||
|
});
|
||
|
});
|
||
|
}
|