本文整理汇总了TypeScript中monk.id函数的典型用法代码示例。如果您正苦于以下问题:TypeScript id函数的具体用法?TypeScript id怎么用?TypeScript id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了id函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('The deleted player page ', function () {
const tribe = {
_id: monk.id(),
id: 'delete_me',
name: 'Change Me'
};
const player1 = {_id: monk.id(), tribe: tribe.id, name: "player1", isDeleted: true};
const players = [player1];
beforeAll(async function () {
await tribeCollection.drop();
await tribeCollection.insert(tribe);
await e2eHelp.authorizeUserForTribes([tribe.id]);
await browser.get(`${hostName}/test-login?username=${e2eHelp.userEmail}&password="pw"`);
await playersCollection.drop();
await playersCollection.insert(players);
});
afterAll(async function () {
await tribeCollection.remove({id: tribe.id}, false);
await playersCollection.drop();
});
e2eHelp.afterEachAssertLogsAreEmpty();
it('will show the player data', async function () {
await browser.setLocation(`/${tribe.id}/retired-player/${player1._id}`);
expect(await deletedPlayerPage.playerNameTextField.getAttribute('value'))
.toBe(player1.name)
})
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:34,代码来源:retired-player.e2e.ts
示例2: describe
describe("GET", function () {
let expectedPins = [
{_id: monk.id(), name: '1', tribe: tribeId},
{_id: monk.id(), name: '2', tribe: tribeId},
{_id: monk.id(), name: '3', tribe: tribeId}
];
beforeEach(function (done) {
pinCollection.remove({tribe: tribeId})
.then(function () {
return pinCollection.insert(expectedPins)
})
.then(done, done.fail);
});
afterEach(function (done) {
pinCollection.remove({tribe: tribeId})
.then(done, done.fail);
});
it('will return all available pins on tribe.', function (done) {
agent.get(path)
.expect(200)
.expect('Content-Type', /json/)
.then(function (response) {
expect(clean(response.body)).toEqual(clean(expectedPins));
})
.then(done, done.fail);
});
it('will return error when tribe is not available.', async function () {
await agent.get(badTribePath)
.expect(404)
});
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:35,代码来源:pins-spec.ts
示例3: beforeAll
beforeAll(async function () {
const pairAssignmentSet1 = new PairAssignmentDocument(new Date().toISOString(), [[
{
name: 'Ollie',
_id: monk.id()
},
{
name: 'Speedy',
_id: monk.id()
}
]]);
const pairAssignmentSet2 = new PairAssignmentDocument(new Date().toISOString(), [[
{name: 'Arthur', _id: monk.id()},
{name: 'Garth', _id: monk.id()}
]]);
const apiGuy = await ApiGuy.new();
await apiGuy.postTribe(tribe);
await Promise.all([
e2eHelp.authorizeUserForTribes([tribe.id]),
apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet1),
apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet2)
]);
await browser.waitForAngular();
await browser.setLocation(`/${tribe.id}/history`);
await browser.wait(() => element(By.id('history-view')).isPresent(), 2000)
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:29,代码来源:history.e2e.ts
示例4: describe
describe('The retired players page', function () {
const tribe = {
id: 'graveyard',
name: 'Arkham Asylum'
};
const player1 = {_id: monk.id(), tribe: tribe.id, name: "player1", isDeleted: true};
const player2 = {_id: monk.id(), tribe: tribe.id, name: "player2", isDeleted: true};
const player3 = {_id: monk.id(), tribe: tribe.id, name: "player3", isDeleted: null};
const player4 = {_id: monk.id(), tribe: tribe.id, name: "player4", isDeleted: true};
const players = [
player1,
player2,
player3,
player4
];
const retiredPlayers = [
player1,
player2,
player4
];
beforeAll(async function () {
await tribeCollection.insert(tribe);
await e2eHelp.authorizeUserForTribes([tribe.id]);
await playersCollection.drop();
await playersCollection.insert(players);
await browser.get(`${hostName}/test-login?username=${e2eHelp.userEmail}&password="pw"`);
await browser.waitForAngular();
});
afterAll(async function () {
await tribeCollection.remove({id: tribe.id}, false)
});
e2eHelp.afterEachAssertLogsAreEmpty();
beforeEach(async function () {
await browser.setLocation(`/${tribe.id}/players/retired`);
});
it('shows the retired players', async function () {
const playerElements = element.all(By.repeater('player in retiredPlayers'));
expect(playerElements.getText()).toEqual(pluck('name', retiredPlayers));
});
it('has a tribe card', function () {
const tribeCardHeaderElement = element(By.className("tribe-card-header"));
expect(tribeCardHeaderElement.getText()).toEqual(tribe.name);
});
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:55,代码来源:retired-players.e2e.ts
示例5: describe
describe('DELETE', function () {
let newTribe = {
name: 'TeamMadeByTest',
id: 'deleteme',
email: '[email protected]',
badgesEnabled: true,
_id: monk.id()
};
it('will remove a tribe from regular communications.', async function () {
await host.post(path)
.send(newTribe)
.expect(200)
.expect('Content-Type', /json/);
await host.delete(path + "/deleteme")
.expect(200);
const getAllResponse = await host.get(path)
.expect(200)
.expect('Content-Type', /json/);
const result = find(function (element) {
return element.name === 'TeamMadeByTest'
}, getAllResponse.body);
expect(result).toBeUndefined();
await host.get(path + '/deleteme')
.expect(404)
.expect('Content-Type', /json/);
});
})
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:34,代码来源:tribes-spec.ts
示例6: it
it('GET will not return the tribe if a player had that email but had it removed.', async function () {
let tribe = {id: 'delete-me', name: 'tribe-from-endpoint-tests'};
let playerId = monk.id();
await Bluebird.all([
host.post(path).send(tribe),
host.post(path + '/players').send({
_id: playerId,
name: 'delete-me',
tribe: 'delete-me',
email: userEmail + '._temp'
})
]);
await authorizeUserForTribes([]);
await host.post(path + '/players').send({
_id: playerId,
name: 'delete-me',
tribe: 'delete-me',
email: 'something else '
});
const response = await host.get(path)
.expect(200)
.expect('Content-Type', /json/);
expect(clean(response.body)).toEqual(clean([]));
await Bluebird.all([
tribesCollection.remove({id: 'delete-me'}, false),
playersCollection.remove({_id: playerId})
]);
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:32,代码来源:tribes-spec.ts
示例7: it
it('will return an error when the player does not exist.', function (done) {
let badId = monk.id();
let httpDelete = couplingServer.delete(path + "/" + badId);
httpDelete
.expect(404)
.expect({message: 'Player could not be deleted because they do not exist.'})
.then(done, done.fail);
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:8,代码来源:players-spec.ts
示例8: setTimeout
setTimeout(function () {
let badId = monk.id();
agent.delete(path + '/' + badId)
.expect(404)
.then(function (response) {
expect(response.body).toEqual({message: 'Pair Assignments could not be deleted because they do not exist.'});
})
.then(done, done.fail);
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:9,代码来源:history-spec.ts
示例9: it
it('will fail when pin does not exist', function (done) {
let httpDelete = agent.delete(path + "/" + monk.id());
httpDelete
.expect('Content-Type', /json/)
.expect(404)
.then(function (response) {
expect(response.body).toEqual({message: 'Failed to remove the pin because it did not exist.'});
})
.then(done, done.fail);
});
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:10,代码来源:pins-spec.ts
注:本文中的monk.id函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论