make test more robust to handle multiple toolbars

This commit is contained in:
Colin Kuskie 2006-10-21 16:44:51 +00:00
parent 2b73d1ee2d
commit ab502e84d8

View file

@ -141,13 +141,21 @@ is($anchorTag, undef, "moveDown: no anchor tag when disabled is set");
#
####################################################
my $toolbarOptions = $session->icon->getToolbarOptions();
my $expectedOptions = {
useLanguageDefault => $i18n->get('1084', 'WebGUI'),
bullet => 'bullet',
};
my $toolbarDir = join '/', $session->config->get('extrasPath'), 'toolbar';
my $dirOpened = opendir my $tbdir, $toolbarDir or diag "uh-oh: $!";
SKIP: {
skip 'No toolbar dir', 1 unless $dirOpened;
my @toolbarDirs = grep {! /^\./ } readdir $tbdir;
push @toolbarDirs, 'useLanguageDefault';
my $toolbarOptions = $session->icon->getToolbarOptions();
my @toolbarOptionDirs = keys %{ $toolbarOptions };
cmp_bag(\@toolbarDirs, \@toolbarOptionDirs, 'getToolbarOptions');
}
cmp_deeply($expectedOptions, $toolbarOptions, 'getToolbarOptions');
sub linkAndText {
my ($text, $tag, @params) = @_;