本文整理汇总了TypeScript中models/users/spec/fixtures.usersJSON函数的典型用法代码示例。如果您正苦于以下问题:TypeScript usersJSON函数的具体用法?TypeScript usersJSON怎么用?TypeScript usersJSON使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了usersJSON函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should remove user by username", () => {
const users = Users.fromJSON(usersJSON());
const user = Users.fromJSON(usersJSON())[2];
user.displayName("Testing replace");
const originalUser = users[2];
users.replace(user);
// not the same object
expect(originalUser).not.toEqual(users[2]);
expect(user).toEqual(users[2]);
});
示例2: it
it("should deserialize User JSON", () => {
const users = Users.fromJSON(usersJSON());
expect(users).toHaveLength(7);
const rootUser = users[0];
const rootUserJSON = usersJSON()._embedded.users[0];
expect(rootUser.loginName()).toEqual(rootUserJSON.login_name);
expect(rootUser.displayName()).toEqual(rootUserJSON.display_name as string);
expect(rootUser.enabled()).toEqual(rootUserJSON.enabled as boolean);
expect(rootUser.email()).toEqual(rootUserJSON.email as string);
expect(rootUser.emailMe()).toEqual(rootUserJSON.email_me as boolean);
expect(rootUser.checkinAliases()).toEqual(rootUserJSON.checkin_aliases as string[]);
});
示例3: it
it("should return all users when no search query is provided", () => {
const users = Users.fromJSON(usersJSON());
const userFilters = new UserFilters();
const filteredUsers = userFilters.performFilteringOn(users);
expect(filteredUsers.totalUsersCount()).toBe(7);
expect(userFilters.searchText()).toBe("");
});